Beispiel #1
0
        public static string PrettyKeyDecryptDump(byte[] decrypt_data, DecryptionKey decryption_key)
        {
            string decryption_key_str = $"{decryption_key.Key} keyType={decryption_key.KeyType.GetDisplayDescription()}";

            if (decryption_key.KeyType == KeyType.SHARE_KEY)
            {
                decryption_key_str += $" prikey={decryption_key.PrivateKey}";
                decryption_key_str += $" pubkey={decryption_key.PublicKey}";
            }
            return($"\n\n[key={decryption_key_str}\n{decrypt_data.HexDump()}]\n\n");
        }
Beispiel #2
0
        public static byte[] TeaKeyLogDecrypt(byte[] In, out DecryptionKey decryptionKey)
        {
            decryptionKey = null;
            List <DecryptionKey> keys = Keys.ToList();

            foreach (DecryptionKey t in keys)
            {
                var d = Tea.Decrypt(In, t.Key.DecodeHex());
                if (d != null)
                {
                    decryptionKey = t;
                    return(d);
                }
            }
            return(null);
        }