os/security/crypto/weakcryptospi/test/tcryptospi/testdata/hashhmac/readme.txt
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
*********************************
sl@0
     2
"HashGen.pl" README DOCUMENTATION
sl@0
     3
sl@0
     4
Paul Sinfield
sl@0
     5
v1.0
sl@0
     6
28/02/2007
sl@0
     7
*********************************
sl@0
     8
sl@0
     9
The hashgen.pl script generates Hash and Hmac expected Hexadecimal string values for a given source file and the specified secret key.
sl@0
    10
sl@0
    11
The following hash algorithms are supported:
sl@0
    12
sl@0
    13
HASH: MD2/MD4/MD5/SHA-1
sl@0
    14
HMAC: MD2/MD4/MD5/SHA-1
sl@0
    15
sl@0
    16
sl@0
    17
1. Before running the script file, please ensure that the following files have been copied into the "c:\apps\perl\site\lib\digest" directory:
sl@0
    18
sl@0
    19
HMAC-MD2.pm
sl@0
    20
HMAC-MD4.pm
sl@0
    21
sl@0
    22
sl@0
    23
2. The script takes 2 arguments as follows:
sl@0
    24
sl@0
    25
hashgen.pl <Source File Path> <Key>
sl@0
    26
sl@0
    27
e.g. hashgen.pl "C:\testdata\tcryptospi\data\LargeHash-SRC.dat" CryptoSpiValidKey
sl@0
    28
sl@0
    29
NOTE: Please ensure that speech marks ("") are placed around arguments that have spaces in them, such as file paths.
sl@0
    30
sl@0
    31
sl@0
    32
3. Once the script has been run, the results will be output a text file with the same name as the source but with a suffix "*_HASHES.txt", within the same directory.
sl@0
    33
sl@0
    34
e.g. LargeHash-SRC_HASHDATA.txt
sl@0
    35
sl@0
    36
An example of the files contents are displayed below:
sl@0
    37
sl@0
    38
****** HASH MD2/MD4/MD5/SHA1 ******
sl@0
    39
sl@0
    40
MD2: 359df8d2cc91db9c8ec0f61718b65a60
sl@0
    41
MD4: 826598b8fa06b7deafd255280319e38b
sl@0
    42
MD5: 201f59b84894f378e1cce73abea86ca6
sl@0
    43
SHA1: 21ef662c79cb3e972a3bb71937381b26e0daa2fc
sl@0
    44
sl@0
    45
****** HMAC MD2/MD4/MD5/SHA1 ******
sl@0
    46
sl@0
    47
HMAC-MD2: 50635299e47531b4913abf986c063054
sl@0
    48
HMAC-MD4: 9e1734fe8dae94d48a9b8fbdd1b55d3a
sl@0
    49
HMAC-MD5: 0db3d1f04967261a9761140f44ef0c4a
sl@0
    50
HMAC-SHA1: 101607c5a079b69c439f307e0590af588c9bf7e2
sl@0
    51
sl@0
    52
Key: CryptoSpiValidKey
sl@0
    53
sl@0
    54
sl@0
    55
*********************************
sl@0
    56
"HashGenSha2.pl" README DOCUMENTATION
sl@0
    57
sl@0
    58
*********************************
sl@0
    59
sl@0
    60
The hashgensha2.pl script generates Hash and Hmac expected Hexadecimal string values for a given source file and the specified secret key for Sha224, Sha256, Sha384 and Sha 512.
sl@0
    61
sl@0
    62
Before Running the script file, ensure that openssl is installed onto the system.
sl@0
    63
sl@0
    64
The script takes 2 arguments as follows:
sl@0
    65
hashgensha2.pl <Source File>  <Key>
sl@0
    66
sl@0
    67
e.g. hashgen.pl "LargeHash-SRC.dat" CryptoSpiValidKey
sl@0
    68
sl@0
    69
3. Once the script has been run, the results will be output a text file with the same name as the source but with a suffix "*_SHA2HASHDATA.txt", within the same directory.
sl@0
    70
sl@0
    71
e.g. largehash-src_SHA2HASHDATA.txt
sl@0
    72
sl@0
    73
An example of the files contents are displayed below:
sl@0
    74
****** HASH SHA224/SHA256/SHA384/SHA512 ******
sl@0
    75
sl@0
    76
SHA224(largehash-src.dat)= c363a255fc7db36aeecfcfa6f9790ecb75043a0f5ebe8cc79a3c7a6a
sl@0
    77
SHA256(largehash-src.dat)= 83b7bc6895df985de5543e8cd2b150232a4b9b4ba093c92fec725a924e4279aa
sl@0
    78
SHA384(largehash-src.dat)= 7785397e9094c917e76c0ed1cfdb59c073f5ec4d29c503c6c8f28bfde1ee46bd43f21ca7f49b754f6cc94ff37e50798c
sl@0
    79
SHA512(largehash-src.dat)= e93c8160c1a9888d8a03a8ffa97a3682597789b9e5250a0cffa0ac984c85e557356201068ef5fa3e968a7623597ba65c50248dab70233f68e547bbc03e58e441
sl@0
    80
sl@0
    81
sl@0
    82
****** HMAC SHA224/SHA256/SHA384/SHA512 ******
sl@0
    83
sl@0
    84
HMAC-SHA224(largehash-src.dat)= e811df3c4ef67a7ef57baffa7e796a5ec2bfec357eb8ef03dabc9c97
sl@0
    85
HMAC-SHA256(largehash-src.dat)= 7bdcc4bed110ccafd5b152de05af95441bce9a1e608abb7e46b10c2e7cee7dc9
sl@0
    86
HMAC-SHA384(largehash-src.dat)= 258d6725d583482bca882af8b8a18f9ec2c002047051beda50d447aedb7721ef0c4511c04a71f82641ce865a2e83dd21
sl@0
    87
HMAC-SHA512(largehash-src.dat)= 38e9456ce22cb3ba6a642bb9ca2d3c8722dad96397da1cfa6ff072eaf8cd661798be8f9b3af7f2b4e930fc4370351f891a2b938cb4d312faae13cccd06fc302c