Cryptography Tutorials - Tutorial Addendum - Bulletin Abstract - SHA1 Algorithm

games appcolt utilitiesappsios mac appcolt
 31 December 18:00   

    



    



    

(Continued from antecedent part...)

    



    

If you run this sample program with PHP 5, you should get:

    

 

    

SHA1("") =

    

da39a3ee5e6b4b0d3255bfef95601890afd80709

    

SHA1("abc") =

    

a9993e364706816aba3e25717850c26c9cd0d89d

    

SHA1("abcdefghijklmnopqrstuvwxyz") =

    

32d10c7b8cf96570ca04ce37f2a19d84240d3a89

    



    



    

SHA1 Accomplishing in Perl

    



    

If you are absorbed in using SHA1 in Perl, you can attending a actual absorbing

    

implementation by John Allen in 8 curve of perl5, see

    

http://www.cypherspace.org/adam/rsa/sha.html. Actuality is a archetype of John s code,

    

stored in PerlSha1In8Lines.pl:

    



    

#!/usr/bin/perl -iD9T4C`>_-JXF8NMS^$#)4=L/2X?!:@GF9;MGKH8;O-S*8L 6

    

@A=unpack"N*",unpack u,$^I;@K=splice@A,5,4;sub M{($x=pop)-($m=1+~0)*int$x/$m};

    

sub L{$n=pop;($x=pop)<<$n|2**$n-1&$x>>32-$n}@F=(sub{$b&($c^$d)^$d},$S=sub{$b^$c

    

^$d},sub{($b|$c)&$d|$b&$c},$S);do{$l+=$r=read STDIN,$_,64;$r++,$_.="x80"if$r<

    

64&&!$p++;@W=unpack N16,$_."

 


Tags: program, message, command, notes, tutorial, tutorials

 perlsha1in8lines, algorithm, copied, command, unpack, program, digest, message, , perl perlsha1in8lines, copied perl, sha1 algorithm, message digest, copied perl perlsha1in8lines, digest sha1 algorithm, message digest sha1, notes message digest, tutorials tutorial notes, tutorial notes message, cryptography tutorials tutorial,

Share Cryptography Tutorials - Tutorial Addendum - Bulletin Abstract - SHA1 Algorithm:
Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

Permalink
Article In : Computers & Technology  -  crypto