Encryption: SHA1 + Base64

I've started to write a simple plugin for Monkey HTTP Daemon which will perform the HTTP Basic Authentication, i had to deal finding simple functions to perform Base64 and SHA1 encryption without use external dependencies such as OpenSSL or similars. Finally after waste my time with some buggy SHA1 functions,  i got the implementation written by Linus Torvalds for GIT project.

My test cases are working as expected, so i'm placing a tarball with the code and examples, feel free to to use it in your open projects:

http://monkey-project.com/~edsiper/misc/sha1_b64.tar.gz

  • download the tarball
  • tar zxfv sha1_b64.tar.gz
  • cd sha1_b64/
  • make
  • ./example
  • php example.php

happy encryption 🙂