コード例 #1
0
ファイル: aes.cs プロジェクト: lokeshshinde79/mugsy
        /// <summary>
        /// Initializes the simple AES class.
        /// </summary>
        public SimpleAES(Byte[] Vector)
        {
            PrivateKey key = new PrivateKey();

            this.Key    = key.GetKey();
            this.Vector = Vector;
            //This is our encryption method
            RijndaelManaged rm = new RijndaelManaged();

            //Create an encryptor and a decryptor using our encryption method, key, and vector.
            EncryptorTransform = rm.CreateEncryptor(this.Key, this.Vector);
            DecryptorTransform = rm.CreateDecryptor(this.Key, this.Vector);

            //Used to translate bytes to text and vice versa
            UTFEncoder = new System.Text.UTF8Encoding();
        }