public EncrytpedRecord(Unpacker unpacker) { KeyInfo = SecretKeyInfo.Restore(unpacker); SecretInput = new ScryptInput(unpacker); unpacker.Unpack(out byte[] data); RecordData = Encryption.Restore(new ArraySegment <byte>(data)); }
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; })); }
EncrytpedRecord(SecretKeyInfo keyInfo, ScryptInput secretInput, Encryption recordData) { KeyInfo = keyInfo; SecretInput = secretInput; RecordData = recordData; }