Example #1
0
        public EncryptedText(string pw, byte[] s)
        {
            aes  = new AesCryptoServiceProvider();
            rng  = new RNGCryptoServiceProvider();
            salt = new EncryptedTextSalt();

            if (s == null)
            {
                salt.populate(rng);
            }
            else
            {
                salt.salt = new Tools.ByValData.ByValFixedByteArray16(s);
            }

            pf = new Rfc2898DeriveBytes(pw, salt.salt.data);

            key     = pf.GetBytes(32);
            aes.Key = key;
            aes.IV  = salt.salt.data; //DamienG.Security.Cryptography.Crc32.Compute(salt.salt.data).ToByteArray();
        }
Example #2
0
 public EncryptedTextContainer(byte[] e, EncryptedTextSalt s)
 {
     Data = e;
     Salt = s.salt.data;
 }