GitXplorerGitXplorer
a

OpenSSLCrypto.jl

public
3 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
074e4edf4fdc860f81d73bccefceb7685de23497

fixed loop in md5 from io

aamitmurthy committed 12 years ago
Unverified
bc93591b7c29013408d6445c571d966ee8775ef5

doc

aamitmurthy committed 12 years ago
Unverified
e337aed1b660cd0df6f0b309adffe4363c80eec9

doc

aamitmurthy committed 12 years ago
Unverified
b83854e0077205d55370bbabe9ed6748088f9b1b

doc changes

aamitmurthy committed 12 years ago
Unverified
ff7d448bcfa4019b08c8164b24c5ae537a1cd794

doc

aamitmurthy committed 12 years ago
Unverified
cab23ab4b6563bf599cd2e58501062d72a77ad2c

doc changes

aamitmurthy committed 12 years ago

README

The README file for this repository.

OpenSSLCrypto

Julia interface to crypto functions from OpenSSL.

gen/generate.jl generates the wrapper using Clang.jl

src/crpyto_* files are the generated files src/Crypto.jl and OpenSSL.jl includes the generated files

Usage

  • Currently functions in openssl/md5.h, openssl/hmac.h, openssl/sha.h and openssl/evp.h have been wrapped

  • Please refer to openssl documentation on using them

  • The EVP_* family of functions provide higer level functions for other lower level openssl functions.

  • man EVP_DigestInit has information on using them.

  • Additionally, the following utility functions have been provided.

hmacsha256_digest(s::String, k::Union(String, Vector{Uint8})) -> Vector{Uint8} returns a 32 byte HMACSHA256 digest for the given data and key

hmacsha1_digest(s::String, k::Union(String, Vector{Uint8})) -> Vector{Uint8} returns a 20 byte HMACSHA1 digest for given data and key

md5(s::String) -> Vector{Uint8} is a regular 16 byte MD5 digest of the string

md5(s::IO) -> Vector{Uint8} same as md5 above, except that it processes the IOStream or IOBuffer in 64K chunks

Example

using OpenSSLCrypto.Crypto
sb = bytes2hex(Crypto.hmacsha256_digest("The quick brown fox jumps over the lazy dog", "key"))
assert(sb == "f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8")

TODO

  • More utility functions
  • More crypto functions exposed