source: project/wiki/eggref/4/pbkdf2 @ 36645

Last change on this file since 36645 was 36645, checked in by svnwiki, 3 months ago

Anonymous wiki edit for IP [91.13.183.20]:

File size: 3.1 KB
RevLine 
[36644]1== PBKDF2
2[[toc:]]
3
4=== Description
5Password-Based Key Derivation Function 2 as defined in [[https://tools.ietf.org/html/rfc2898#section-5.2|RFC2898]]
6
7=== Author
8Tobias Heilig <off_world at gmx . de>
9
10=== Repository
11[[https://github.com/off-world/pbkdf2]]
12
13=== Requirements
[36645]14* [[http://api.call-cc.org/doc/hmac|hmac]]
15* [[http://api.call-cc.org/doc/sha1|sha1]]
16* [[http://api.call-cc.org/doc/sha2|sha2]]
[36644]17
18=== API
19
20==== Common Argument Definitions
21===== result-type
22; {{'string}} : return resulting bytes as a byte-string
23; {{'hex}} : return resulting bytes as a string of lower-case hexadecimal digits
24; {{'blob}} : return resulting bytes as a blob
25; {{'u8vector}} : return resulting bytes as a u8vector
26
27===== password
28password as a string
29
30===== salt
31salt as a string
32
33===== count
34iteration count as a positive exact integer
35
36===== dklen
37length in bytes of the derived key as a positive exact integer
38
39==== Procedures
40===== pbkdf2-hmac-sha1
41<procedure>(pbkdf2-hmac-sha1 password salt count dklen #!optional (result-type 'blob)</procedure>
42
43===== pbkdf2-hmac-sha256
44<procedure>(pbkdf2-hmac-sha256 password salt count dklen #!optional (result-type 'blob)</procedure>
45
46===== pbkdf2-hmac-sha384
47<procedure>(pbkdf2-hmac-sha384 password salt count dklen #!optional (result-type 'blob)</procedure>
48
49===== pbkdf2-hmac-sha512
50<procedure>(pbkdf2-hmac-sha512 password salt count dklen #!optional (result-type 'blob)</procedure>
51
52=== Examples
53 (use pbkdf2)
[36645]54 
[36644]55 (pbkdf2-hmac-sha1 "password" "salt" 4096 20)
[36645]56 ;=> #${4b007901b765489abead49d926f721d065a429c1}
57 
[36644]58 (pbkdf2-hmac-sha1 "password" "salt" 4096 20 'hex)
[36645]59 ;=> "4b007901b765489abead49d926f721d065a429c1"
[36644]60
61=== License
62 Copyright (c) 2018, Tobias Heilig
63 All rights reserved.
[36645]64 
[36644]65 Redistribution and use in source and binary forms, with or without
66 modification, are permitted provided that the following conditions
67 are met:
[36645]68 
[36644]69 1. Redistributions of source code must retain the above copyright
70    notice, this list of conditions and the following disclaimer.
71 2. Redistributions in binary form must reproduce the above copyright
72    notice, this list of conditions and the following disclaimer in the
73    documentation and/or other materials provided with the distribution.
74 3. The name of the authors may not be used to endorse or promote products
75    derived from this software without specific prior written permission.
[36645]76 
[36644]77 THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
78 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
79 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
80 ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
81 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
82 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
83 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
84 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
85 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
86 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
87 IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88
89=== Version History
90; 1.0 : initial release
Note: See TracBrowser for help on using the repository browser.