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 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax