Esempio n. 1
0
        private Credentials DecryptEntry(ResponseEntry entry, string IV)
        {
            string userName, password;

            using (var decryptor = this.aes.CreateDecryptor(this.Key, Utilities.Decode64(IV)))
            {
                byte[] bytes = Utilities.Decode64(entry.Password);
                password = Encoding.UTF8.GetString(decryptor.TransformFinalBlock(bytes, 0, bytes.Length));
                bytes    = Utilities.Decode64(entry.Login);
                userName = Encoding.UTF8.GetString(decryptor.TransformFinalBlock(bytes, 0, bytes.Length));
            }

            return(new Credentials(userName, password));
        }
Esempio n. 2
0
        private Credentials DecryptEntry(ResponseEntry entry, string IV)
        {
            string userName, password;

            using (var decryptor = this.aes.CreateDecryptor(this.Key, Utilities.Decode64(IV)))
            {
                byte[] bytes = Utilities.Decode64(entry.Password);
                password = Encoding.UTF8.GetString(decryptor.TransformFinalBlock(bytes, 0, bytes.Length));
                bytes = Utilities.Decode64(entry.Login);
                userName = Encoding.UTF8.GetString(decryptor.TransformFinalBlock(bytes, 0, bytes.Length));
            }

            return new Credentials(userName, password);
        }