Esempio n. 1
0
        public byte[] Decrypt(byte[] ciphertext)
        {
            PublicKey    pubKey = new PublicKey(ciphertext.Take(33).ToArray());
            SymmetricKey aes    = ExchangeKey(pubKey);

            return(aes.Decrypt(ciphertext, 33));
        }
Esempio n. 2
0
        public byte[] Decrypt(byte[] ciphertext)
        {
            PublicKey    pubKey = new PublicKey(ciphertext.Take(33).ToArray());
            SymmetricKey aes    = ExchangeKey(pubKey);

            // FIXME: This merely returns null when the given ciphertext is
            // invalid (which means it is not encrypted with the corresponding
            // public key for the most part).  This should become to throw
            // an appropriate exception instead and also reflected to docs
            // comment (to add <exception> tag) as well.
            return(aes.Decrypt(ciphertext, 33));
        }