Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- password = '1234567890'
- salt = '0987654321'
- length = 16
- iterations = 2
- $AsciiEncoder = New-Object System.Text.ASCIIEncoding;
- $DerivedPass = New-Object System.Security.Cryptography.PasswordDeriveBytes('1234567890', $AsciiEncoder.GetBytes('0987654321'), "SHA1", 2);
- [Byte[]] $KeyBytes = $DerivedPass.GetBytes(16);
- -join($KeyBytes | ForEach { $_.ToString("X2")});
- C937511EBDBE12C7A0FCC8D6CB42BEDC
- from Crypto.Protocol import KDF
- from Crypto.Hash import SHA1
- def password_derive_key(password, salt, length, count):
- return KDF.PBKDF2(password, salt, length, count)
- def main():
- derivedKey = password_derive_key('1234567890', '0987654321', 16, 1000)
- print derivedKey.encode('hex')
- if __name__ == "__main__":
- main()
- 42e8bfc7fc5fd4686915d49d5a29bc1e
Add Comment
Please, Sign In to add comment