Пример #1
0
 public EncrytpedRecord(Unpacker unpacker)
 {
     KeyInfo     = SecretKeyInfo.Restore(unpacker);
     SecretInput = new ScryptInput(unpacker);
     unpacker.Unpack(out byte[] data);
     RecordData = Encryption.Restore(new ArraySegment <byte>(data));
 }
Пример #2
0
        public Task <byte[]> DecryptData(Encryption encryptedData, ScryptInput secretInfo)
        {
            return(Task.Run(() =>
            {
                try
                {
                    var decpw = ScryptEncoder.Encode(SecretHash, secretInfo);
                    return encryptedData.Decrypt(decpw.Hash);
                }
                catch { }

                return null;
            }));
        }
Пример #3
0
 EncrytpedRecord(SecretKeyInfo keyInfo, ScryptInput secretInput, Encryption recordData)
 {
     KeyInfo     = keyInfo;
     SecretInput = secretInput;
     RecordData  = recordData;
 }