Module wsdk_crypto

WSDK crypto functions.

Copyright 2010-2012 ALEPH ARCHIVES Ltd. All rights reserved.

Version: 1.0.0

Behaviours: ?GEN_SERVER.

Authors: Aleph Archives Ltd. [web site: http://aleph-archives.com/].

Description

WSDK crypto functions

This module provides a set of cryptographic functions.

References:

Data Types

passwd_modes()

passwd_modes() = alphanum | mixed | numeric | alpha

Function Index

digest_to_hex/1Provides a string representation of the Hexadecimal value of a digest (MD5, SHA1, SHA224, SHA256, SHA384, and SHA512).
md5/1Computes an MD5 message digest from Data, where the length of the digest is 128 bits (16 bytes).
md5/2Finishes the update of an MD5 Context and returns the computed MD5 message digest.
md5/3Updates an MD5 Context with Data, and returns a NewContext.
passwd/0Generate an 8 length alphanum password.
passwd/1Generate an 'alphanum' password of size Length.
passwd/2Generate a password of size Length and type Type,.
sha1/1Computes an SHA message digest from Data, where the length of the digest is 160 bits (20 bytes).
sha1/2Finishes the update of an SHA Context and returns the computed SHA message digest.
sha1/3Updates an SHA Context with Data, and returns a NewContext.
sha224/1Computes a SHA-224 message digest from Data, where the length of the digest is 224 bits (28 bytes).
sha224/2Finishes the update of a SHA-224 Context and returns the computed message digest.
sha224/3Updates a SHA-224 context with message data and returns a new context.
sha256/1Computes a SHA-256 message digest from Data, where the length of the digest is 256 bits (32 bytes).
sha256/2Finishes the update of a SHA-256 Context and returns the computed message digest.
sha256/3Updates a SHA-256 context with message data and returns a new context.
sha384/1Computes a SHA-384 message digest from Data, where the length of the digest is 384 bits (32 bytes).
sha384/2Finishes the update of a SHA-384 Context and returns the computed message digest.
sha384/3Updates a SHA-384 context with message data and returns a new context.
sha512/1Computes a SHA-512 message digest from Data, where the length of the digest is 512 bits (64 bytes).
sha512/2Finishes the update of a SHA-512 Context and returns the computed message digest.
sha512/3Updates a SHA-512 context with message data and returns a new context.

Function Details

digest_to_hex/1

digest_to_hex(BinDigest::binary()) -> [byte()]

Provides a string representation of the Hexadecimal value of a digest (MD5, SHA1, SHA224, SHA256, SHA384, and SHA512).

md5/1

md5(Selector::init | iodata()) -> binary()

Computes an MD5 message digest from Data, where the length of the digest is 128 bits (16 bytes).

When 'init' is passed, creates an MD5 context to be used in subsequent calls to md5/3

md5/2

md5(Selector::final, Ctx::binary()) -> binary()

Finishes the update of an MD5 Context and returns the computed MD5 message digest.

md5/3

md5(Selector::update, Ctx::binary(), Data::iodata()) -> binary()

Updates an MD5 Context with Data, and returns a NewContext.

passwd/0

passwd() -> [byte()]

Generate an 8 length alphanum password.

This is equivalent to call: wsdk_crypto:passwd(8).

passwd/1

passwd(Length::non_neg_integer()) -> [byte()]

Generate an 'alphanum' password of size Length.

This is equivalent to call: wsdk_crypto:passwd(Length, 'alphanum').

passwd/2

passwd(Length::non_neg_integer(), Mode::passwd_modes()) -> [byte()]

Generate a password of size Length and type Type,

where Type could be: alpha | alphanum | mixed | numeric |

sha1/1

sha1(Selector::init | iodata()) -> binary()

Computes an SHA message digest from Data, where the length of the digest is 160 bits (20 bytes).

When 'init' is passed, creates an SHA context to be used in subsequent calls to sha1/3

sha1/2

sha1(Selector::final, Ctx::binary()) -> binary()

Finishes the update of an SHA Context and returns the computed SHA message digest.

sha1/3

sha1(Selector::update, Ctx::binary(), Data::iodata()) -> binary()

Updates an SHA Context with Data, and returns a NewContext.

sha224/1

sha224(Selector::init | iodata()) -> binary()

Computes a SHA-224 message digest from Data, where the length of the digest is 224 bits (28 bytes).

When 'init' is passed, it creates a SHA-224 context to be in subsequent calls to sha224/3.

sha224/2

sha224(Selector::final, Ctx::binary()) -> binary()

Finishes the update of a SHA-224 Context and returns the computed message digest.

sha224/3

sha224(Selector::update, Ctx::binary(), Data::iodata()) -> binary()

Updates a SHA-224 context with message data and returns a new context.

sha256/1

sha256(Selector::init | iodata()) -> binary()

Computes a SHA-256 message digest from Data, where the length of the digest is 256 bits (32 bytes).

When 'init' is passed, it creates a SHA-256 context to be in subsequent calls to sha256/3.

sha256/2

sha256(Selector::final, Ctx::binary()) -> binary()

Finishes the update of a SHA-256 Context and returns the computed message digest.

sha256/3

sha256(Selector::update, Ctx::binary(), Data::iodata()) -> binary()

Updates a SHA-256 context with message data and returns a new context.

sha384/1

sha384(Selector::init | iodata()) -> binary()

Computes a SHA-384 message digest from Data, where the length of the digest is 384 bits (32 bytes).

When 'init' is passed, it creates a SHA-384 context to be in subsequent calls to sha384/3.

sha384/2

sha384(Selector::final, Ctx::binary()) -> binary()

Finishes the update of a SHA-384 Context and returns the computed message digest.

sha384/3

sha384(Selector::update, Ctx::binary(), Data::iodata()) -> binary()

Updates a SHA-384 context with message data and returns a new context.

sha512/1

sha512(Selector::init | iodata()) -> binary()

Computes a SHA-512 message digest from Data, where the length of the digest is 512 bits (64 bytes).

When 'init' is passed, it creates a SHA-512 context to be in subsequent calls to sha512/3.

sha512/2

sha512(Selector::final, Ctx::binary()) -> binary()

Finishes the update of a SHA-512 Context and returns the computed message digest.

sha512/3

sha512(Selector::update, Ctx::binary(), Data::iodata()) -> binary()

Updates a SHA-512 context with message data and returns a new context.


Generated by EDoc, Sep 5 2012, 17:38:08.