Skip to content

A little toy implementation of SHA1 and SHA256

Notifications You must be signed in to change notification settings

vinchuco/shamwow

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SHAmwow

Sometimes you just want to understand how your hashing algorithms work, so you implement them yourself.

It should go without saying that this was just for fun, and you should never, ever, ever roll your own cryptography primatives for any purpose other than education!

sha1

The sha1 function in shamwow.rb implements the SHA1 hashing function in Ruby, outputting the 160-bit hash as a hexadecimal string.

sources

sha2

The sha2 function in shamwow.rb implements the SHA-256 hashing function in Ruby, outputting the 256-bit hash as a hexadecimal string.

Sources

Tests

shamwow_test.rb contains a few sanity tests for the bit-rotation functions and for the hashes themselves, testing against the output of the Digest gem in the standard library.

Obligatory

ShamWOW

About

A little toy implementation of SHA1 and SHA256

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%