private DeriveKeyFromPass ( byte passphrase, uint passphraseLength, |
||
passphrase | byte | |
passphraseLength | uint | |
outputKey | ||
error | ToxErrorKeyDerivation | |
return | bool |
internal static ToxPassKey? DeriveKey(string passphrase) { byte[] pp = Encoding.UTF8.GetBytes(passphrase); var error = ToxErrorKeyDerivation.Ok; var key = new ToxPassKey(); if (!ToxEncryptionFunctions.DeriveKeyFromPass(pp, (uint)pp.Length, ref key, ref error) || error != ToxErrorKeyDerivation.Ok) return null; return key; }
public static byte[] DeriveKey(string passphrase) { byte[] pp = Encoding.UTF8.GetBytes(passphrase); byte[] key = new byte[ToxEncryptionFunctions.PassKeyLength()]; if (ToxEncryptionFunctions.DeriveKeyFromPass(pp, (uint)pp.Length, key) == -1) { return(null); } return(key); }