Happy !

UdoSchneider / PBKDF2

Project infos

License MIT
Tags
Creation date 2014-08-27
Website http://readthesourceluke.blogspot.de/2014/07/pbkdf2-for-pharo.html

Monticello registration

About PBKDF2

PBKDF2 (Password-Based Key Derivation Function 2)

Introduction

PBKDF2 implementation based on RFC 2898. The only requirement is the Cryptography package.

Installation

Gofer new
    url:  'http://smalltalkhub.com/mc/UdoSchneider/PBKDF2/main';
    package: 'ConfigurationOfPBKDF2';
    load.

(Smalltalk at: #ConfigurationOfPBKDF2) project stableVersion load.

If you want to load the tests as well use:

(Smalltalk at: #ConfigurationOfPBKDF2) project stableVersion load: 'Tests'.

Usage

derivedKey := PBKDF2 new
    hashFunction: SHA1;
    password: 'password';
    salt: 'salt';
    iterations: 4096;
    length: 256;
    deriveKey.

You can also use some convenience class methods. E.g.:

 derivedKey := PBKDF2 derivedKeySHA1Password: password salt: salt.

Defaults

  • prf: HMAC-SHA-1
  • iterations: 1000
  • length: 16 Bytes