Example #1
0
        public static PasswordHash HashPassword(this string origin)
        {
            ISerializable edo  = EDObjectContext.CreateInstance();
            PasswordHash  hash = new PasswordHash();

            hash.IV       = edo.IV;
            hash.Key      = edo.Key;
            hash.Password = edo.EncryptoObject(origin);
            hash.Length   = edo.TextBytesLength;

            return(hash);
        }
Example #2
0
        public static string Convert2OriginalPassword
        (
            byte[] password,
            byte[] iv,
            byte[] key,
            int length
        )
        {
            ISerializable edo = EDObjectContext.CreateInstance();

            edo.IV  = iv;
            edo.Key = key;
            return(edo.DecryptoObject(password, length));
        }