diff options
author | Erlang/OTP <[email protected]> | 2009-11-20 14:54:40 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2009-11-20 14:54:40 +0000 |
commit | 84adefa331c4159d432d22840663c38f155cd4c1 (patch) | |
tree | bff9a9c66adda4df2106dfd0e5c053ab182a12bd /lib/crypto/doc/src | |
download | otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.gz otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.bz2 otp-84adefa331c4159d432d22840663c38f155cd4c1.zip |
The R13B03 release.OTP_R13B03
Diffstat (limited to 'lib/crypto/doc/src')
-rw-r--r-- | lib/crypto/doc/src/Makefile | 113 | ||||
-rw-r--r-- | lib/crypto/doc/src/book.xml | 50 | ||||
-rw-r--r-- | lib/crypto/doc/src/crypto.xml | 785 | ||||
-rw-r--r-- | lib/crypto/doc/src/crypto_app.xml | 108 | ||||
-rw-r--r-- | lib/crypto/doc/src/fascicules.xml | 18 | ||||
-rw-r--r-- | lib/crypto/doc/src/insidecover.xml | 26 | ||||
-rw-r--r-- | lib/crypto/doc/src/licenses.xml | 155 | ||||
-rw-r--r-- | lib/crypto/doc/src/make.dep | 20 | ||||
-rw-r--r-- | lib/crypto/doc/src/note.gif | bin | 0 -> 1539 bytes | |||
-rw-r--r-- | lib/crypto/doc/src/notes.xml | 469 | ||||
-rw-r--r-- | lib/crypto/doc/src/ref_man.xml | 49 | ||||
-rw-r--r-- | lib/crypto/doc/src/release_notes.xml | 50 | ||||
-rw-r--r-- | lib/crypto/doc/src/usersguide.xml | 50 | ||||
-rw-r--r-- | lib/crypto/doc/src/warning.gif | bin | 0 -> 1498 bytes |
14 files changed, 1893 insertions, 0 deletions
diff --git a/lib/crypto/doc/src/Makefile b/lib/crypto/doc/src/Makefile new file mode 100644 index 0000000000..d2cec9b11b --- /dev/null +++ b/lib/crypto/doc/src/Makefile @@ -0,0 +1,113 @@ +# ``The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved via the world wide web at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# The Initial Developer of the Original Code is Ericsson Utvecklings AB. +# Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings +# AB. All Rights Reserved.'' +# +# $Id$ +# +include $(ERL_TOP)/make/target.mk +include $(ERL_TOP)/make/$(TARGET)/otp.mk + +# ---------------------------------------------------- +# Application version +# ---------------------------------------------------- +include ../../vsn.mk +VSN=$(CRYPTO_VSN) +APPLICATION=crypto + +# ---------------------------------------------------- +# Release directory specification +# ---------------------------------------------------- +RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN) + +# ---------------------------------------------------- +# Target Specs +# ---------------------------------------------------- +XML_APPLICATION_FILES = ref_man.xml +XML_REF3_FILES = crypto.xml +XML_REF6_FILES = crypto_app.xml + +XML_PART_FILES = release_notes.xml usersguide.xml +XML_CHAPTER_FILES = notes.xml licenses.xml + +BOOK_FILES = book.xml + +GIF_FILES = + +# ---------------------------------------------------- + +HTML_FILES = $(XML_APPLICATION_FILES:%.xml=$(HTMLDIR)/%.html) \ + $(XML_PART_FILES:%.xml=$(HTMLDIR)/%.html) + +INFO_FILE = ../../info + +MAN3_FILES = $(XML_REF3_FILES:%.xml=$(MAN3DIR)/%.3) +MAN6_FILES = $(XML_REF6_FILES:%_app.xml=$(MAN6DIR)/%.6) + +HTML_REF_MAN_FILE = $(HTMLDIR)/index.html + +TOP_PDF_FILE = $(PDFDIR)/$(APPLICATION)-$(VSN).pdf + +# ---------------------------------------------------- +# FLAGS +# ---------------------------------------------------- +XML_FLAGS += + +# ---------------------------------------------------- +# Targets +# ---------------------------------------------------- +$(HTMLDIR)/%.gif: %.gif + $(INSTALL_DATA) $< $@ + + +docs: pdf html man + +$(TOP_PDF_FILE): $(XML_FILES) + +pdf: $(TOP_PDF_FILE) + +html: gifs $(HTML_REF_MAN_FILE) + +man: $(MAN3_FILES) $(MAN6_FILES) + +gifs: $(GIF_FILES:%=$(HTMLDIR)/%) + +debug opt valgrind: + +clean clean_docs clean_tex: + rm -rf $(HTMLDIR)/* + rm -f $(MAN3DIR)/* + rm -f $(MAN6DIR)/* + rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo) + rm -f errs core *~ + +# ---------------------------------------------------- +# Release Target +# ---------------------------------------------------- +include $(ERL_TOP)/make/otp_release_targets.mk + +release_docs_spec: docs + $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf + $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf + $(INSTALL_DIR) $(RELSYSDIR)/doc/html + $(INSTALL_DATA) $(HTMLDIR)/* \ + $(RELSYSDIR)/doc/html + $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR) + $(INSTALL_DIR) $(RELEASE_PATH)/man/man3 + $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3 + $(INSTALL_DIR) $(RELEASE_PATH)/man/man6 + $(INSTALL_DATA) $(MAN6DIR)/* $(RELEASE_PATH)/man/man6 + + +release_spec: + diff --git a/lib/crypto/doc/src/book.xml b/lib/crypto/doc/src/book.xml new file mode 100644 index 0000000000..f07208482c --- /dev/null +++ b/lib/crypto/doc/src/book.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE book SYSTEM "book.dtd"> + +<book xmlns:xi="http://www.w3.org/2001/XInclude"> + <header titlestyle="normal"> + <copyright> + <year>1999</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>crypto</title> + <prepared>Peter Högfeldt</prepared> + <docno></docno> + <date>1999-01-21</date> + <rev>A</rev> + <file>book.sgml</file> + </header> + <insidecover> + <include file="insidecover"></include> + </insidecover> + <pagetext>crypto</pagetext> + <preamble> + <contents level="2"></contents> + </preamble> + <parts lift="no"> + <xi:include href="usersguide.xml"/> + </parts> + <applications> + <xi:include href="ref_man.xml"/> + </applications> + <releasenotes> + <xi:include href="notes.xml"/> + </releasenotes> + <listofterms></listofterms> + <index></index> +</book> + diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml new file mode 100644 index 0000000000..42ba523c8c --- /dev/null +++ b/lib/crypto/doc/src/crypto.xml @@ -0,0 +1,785 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE erlref SYSTEM "erlref.dtd"> + +<erlref> + <header> + <copyright> + <year>1999</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>crypto</title> + <prepared>Peter Högfeldt</prepared> + <docno></docno> + <date>2000-06-20</date> + <rev>B</rev> + </header> + <module>crypto</module> + <modulesummary>Crypto Functions</modulesummary> + <description> + <p>This module provides a set of cryptographic functions. + </p> + <p>References:</p> + <list type="bulleted"> + <item> + <p>md5: The MD5 Message Digest Algorithm (RFC 1321)</p> + </item> + <item> + <p>sha: Secure Hash Standard (FIPS 180-2)</p> + </item> + <item> + <p>hmac: Keyed-Hashing for Message Authentication (RFC 2104)</p> + </item> + <item> + <p>des: Data Encryption Standard (FIPS 46-3)</p> + </item> + <item> + <p>aes: Advanced Encryption Standard (AES) (FIPS 197) </p> + </item> + <item> + <p>ecb, cbc, cfb, ofb: Recommendation for Block Cipher Modes + of Operation (NIST SP 800-38A).</p> + </item> + <item> + <p>rsa: Recommendation for Block Cipher Modes of Operation + (NIST 800-38A)</p> + </item> + <item> + <p>dss: Digital Signature Standard (FIPS 186-2)</p> + </item> + </list> + <p>The above publications can be found at <url href="http://csrc.nist.gov/publications">NIST publications</url>, at <url href="http://www.ietf.org">IETF</url>. + </p> + <p><em>Types</em></p> + <pre> +byte() = 0 ... 255 +ioelem() = byte() | binary() | iolist() +iolist() = [ioelem()] +Mpint() = <![CDATA[<<ByteLen:32/integer-big, Bytes:ByteLen/binary>>]]> + </pre> + <p></p> + </description> + <funcs> + <func> + <name>start() -> ok</name> + <fsummary>Start the crypto server.</fsummary> + <desc> + <p>Starts the crypto server.</p> + </desc> + </func> + <func> + <name>stop() -> ok</name> + <fsummary>Stop the crypto server.</fsummary> + <desc> + <p>Stops the crypto server.</p> + </desc> + </func> + <func> + <name>info() -> [atom()]</name> + <fsummary>Provide a list of available crypto functions.</fsummary> + <desc> + <p>Provides the available crypto functions in terms of a list + of atoms.</p> + </desc> + </func> + <func> + <name>info_lib() -> [{Name,VerNum,VerStr}]</name> + <fsummary>Provides information about the libraries used by crypto.</fsummary> + <type> + <v>Name = binary()</v> + <v>VerNum = integer()</v> + <v>VerStr = binary()</v> + </type> + <desc> + <p>Provides the name and version of the libraries used by crypto.</p> + <p><c>Name</c> is the name of the library. <c>VerNum</c> is + the numeric version according to the library's own versioning + scheme. <c>VerStr</c> contains a text variant of the version.</p> + <pre> +> <input>info_lib().</input> +[{<<"OpenSSL">>,9469983,<<"OpenSSL 0.9.8a 11 Oct 2005">>}] + </pre> + </desc> + </func> + <func> + <name>md5(Data) -> Digest</name> + <fsummary>Compute an <c>MD5</c>message digest from <c>Data</c></fsummary> + <type> + <v>Data = iolist() | binary()</v> + <v>Digest = binary()</v> + </type> + <desc> + <p>Computes an <c>MD5</c> message digest from <c>Data</c>, where + the length of the digest is 128 bits (16 bytes).</p> + </desc> + </func> + <func> + <name>md5_init() -> Context</name> + <fsummary>Creates an MD5 context</fsummary> + <type> + <v>Context = binary()</v> + </type> + <desc> + <p>Creates an MD5 context, to be used in subsequent calls to + <c>md5_update/2</c>.</p> + </desc> + </func> + <func> + <name>md5_update(Context, Data) -> NewContext</name> + <fsummary>Update an MD5 <c>Context</c>with <c>Data</c>, and return a <c>NewContext</c></fsummary> + <type> + <v>Data = iolist() | binary()</v> + <v>Context = NewContext = binary()</v> + </type> + <desc> + <p>Updates an MD5 <c>Context</c> with <c>Data</c>, and returns + a <c>NewContext</c>.</p> + </desc> + </func> + <func> + <name>md5_final(Context) -> Digest</name> + <fsummary>Finish the update of an MD5 <c>Context</c>and return the computed <c>MD5</c>message digest</fsummary> + <type> + <v>Context = Digest = binary()</v> + </type> + <desc> + <p>Finishes the update of an MD5 <c>Context</c> and returns + the computed <c>MD5</c> message digest.</p> + </desc> + </func> + <func> + <name>sha(Data) -> Digest</name> + <fsummary>Compute an <c>SHA</c>message digest from <c>Data</c></fsummary> + <type> + <v>Data = iolist() | binary()</v> + <v>Digest = binary()</v> + </type> + <desc> + <p>Computes an <c>SHA</c> message digest from <c>Data</c>, where + the length of the digest is 160 bits (20 bytes).</p> + </desc> + </func> + <func> + <name>sha_init() -> Context</name> + <fsummary>Create an SHA context</fsummary> + <type> + <v>Context = binary()</v> + </type> + <desc> + <p>Creates an SHA context, to be used in subsequent calls to + <c>sha_update/2</c>.</p> + </desc> + </func> + <func> + <name>sha_update(Context, Data) -> NewContext</name> + <fsummary>Update an SHA context</fsummary> + <type> + <v>Data = iolist() | binary()</v> + <v>Context = NewContext = binary()</v> + </type> + <desc> + <p>Updates an SHA <c>Context</c> with <c>Data</c>, and returns + a <c>NewContext</c>.</p> + </desc> + </func> + <func> + <name>sha_final(Context) -> Digest</name> + <fsummary>Finish the update of an SHA context</fsummary> + <type> + <v>Context = Digest = binary()</v> + </type> + <desc> + <p>Finishes the update of an SHA <c>Context</c> and returns + the computed <c>SHA</c> message digest.</p> + </desc> + </func> + <func> + <name>md5_mac(Key, Data) -> Mac</name> + <fsummary>Compute an <c>MD5 MAC</c>message authentification code</fsummary> + <type> + <v>Key = Data = iolist() | binary()</v> + <v>Mac = binary()</v> + </type> + <desc> + <p>Computes an <c>MD5 MAC</c> message authentification code + from <c>Key</c> and <c>Data</c>, where the the length of the + Mac is 128 bits (16 bytes).</p> + </desc> + </func> + <func> + <name>md5_mac_96(Key, Data) -> Mac</name> + <fsummary>Compute an <c>MD5 MAC</c>message authentification code</fsummary> + <type> + <v>Key = Data = iolist() | binary()</v> + <v>Mac = binary()</v> + </type> + <desc> + <p>Computes an <c>MD5 MAC</c> message authentification code + from <c>Key</c> and <c>Data</c>, where the length of the Mac + is 96 bits (12 bytes).</p> + </desc> + </func> + <func> + <name>sha_mac(Key, Data) -> Mac</name> + <fsummary>Compute an <c>MD5 MAC</c>message authentification code</fsummary> + <type> + <v>Key = Data = iolist() | binary()</v> + <v>Mac = binary()</v> + </type> + <desc> + <p>Computes an <c>SHA MAC</c> message authentification code + from <c>Key</c> and <c>Data</c>, where the length of the Mac + is 160 bits (20 bytes).</p> + </desc> + </func> + <func> + <name>sha_mac_96(Key, Data) -> Mac</name> + <fsummary>Compute an <c>MD5 MAC</c>message authentification code</fsummary> + <type> + <v>Key = Data = iolist() | binary()</v> + <v>Mac = binary()</v> + </type> + <desc> + <p>Computes an <c>SHA MAC</c> message authentification code + from <c>Key</c> and <c>Data</c>, where the length of the Mac + is 96 bits (12 bytes).</p> + </desc> + </func> + <func> + <name>des_cbc_encrypt(Key, IVec, Text) -> Cipher</name> + <fsummary>Encrypt <c>Text</c>according to DES in CBC mode</fsummary> + <type> + <v>Key = Text = iolist() | binary()</v> + <v>IVec = Cipher = binary()</v> + </type> + <desc> + <p>Encrypts <c>Text</c> according to DES in CBC + mode. <c>Text</c> must be a multiple of 64 bits (8 + bytes). <c>Key</c> is the DES key, and <c>IVec</c> is an + arbitrary initializing vector. The lengths of <c>Key</c> and + <c>IVec</c> must be 64 bits (8 bytes).</p> + </desc> + </func> + <func> + <name>des_cbc_decrypt(Key, IVec, Cipher) -> Text</name> + <fsummary>Decrypt <c>Cipher</c>according to DES in CBC mode</fsummary> + <type> + <v>Key = Cipher = iolist() | binary()</v> + <v>IVec = Text = binary()</v> + </type> + <desc> + <p>Decrypts <c>Cipher</c> according to DES in CBC mode. + <c>Key</c> is the DES key, and <c>IVec</c> is an arbitrary + initializing vector. <c>Key</c> and <c>IVec</c> must have + the same values as those used when encrypting. <c>Cipher</c> + must be a multiple of 64 bits (8 bytes). The lengths of + <c>Key</c> and <c>IVec</c> must be 64 bits (8 bytes).</p> + </desc> + </func> + <func> + <name>des_cbc_ivec(Data) -> IVec</name> + <fsummary>Get <c>IVec</c> to be used in next iteration of + <c>des_cbc_[ecrypt|decrypt]</c></fsummary> + <type> + <v>Data = iolist() | binary()</v> + <v>IVec = binary()</v> + </type> + <desc> + <p>Returns the <c>IVec</c> to be used in a next iteration of + <c>des_cbc_[encrypt|decrypt]</c>. <c>Data</c> is the encrypted + data from the previous iteration step.</p> + </desc> + </func> + <func> + <name>des3_cbc_encrypt(Key1, Key2, Key3, IVec, Text) -> Cipher</name> + <fsummary>Encrypt <c>Text</c>according to DES3 in CBC mode</fsummary> + <type> + <v>Key1 =Key2 = Key3 Text = iolist() | binary()</v> + <v>IVec = Cipher = binary()</v> + </type> + <desc> + <p>Encrypts <c>Text</c> according to DES3 in CBC + mode. <c>Text</c> must be a multiple of 64 bits (8 + bytes). <c>Key1</c>, <c>Key2</c>, <c>Key3</c>, are the DES + keys, and <c>IVec</c> is an arbitrary initializing + vector. The lengths of each of <c>Key1</c>, <c>Key2</c>, + <c>Key3</c> and <c>IVec</c> must be 64 bits (8 bytes).</p> + </desc> + </func> + <func> + <name>des3_cbc_decrypt(Key1, Key2, Key3, IVec, Cipher) -> Text</name> + <fsummary>Decrypt <c>Cipher</c>according to DES in CBC mode</fsummary> + <type> + <v>Key1 = Key2 = Key3 = Cipher = iolist() | binary()</v> + <v>IVec = Text = binary()</v> + </type> + <desc> + <p>Decrypts <c>Cipher</c> according to DES3 in CBC mode. + <c>Key1</c>, <c>Key2</c>, <c>Key3</c> are the DES key, and + <c>IVec</c> is an arbitrary initializing vector. + <c>Key1</c>, <c>Key2</c>, <c>Key3</c> and <c>IVec</c> must + and <c>IVec</c> must have the same values as those used when + encrypting. <c>Cipher</c> must be a multiple of 64 bits (8 + bytes). The lengths of <c>Key1</c>, <c>Key2</c>, + <c>Key3</c>, and <c>IVec</c> must be 64 bits (8 bytes).</p> + </desc> + </func> + <func> + <name>blowfish_cfb64_encrypt(Key, IVec, Text) -> Cipher</name> + <fsummary>Encrypt <c>Text</c>using Blowfish in CFB mode with 64 + bit feedback</fsummary> + <type> + <v>Key = Text = iolist() | binary()</v> + <v>IVec = Cipher = binary()</v> + </type> + <desc> + <p>Encrypts <c>Text</c> using Blowfish in CFB mode with 64 bit + feedback. <c>Key</c> is the Blowfish key, and <c>IVec</c> is an + arbitrary initializing vector. The length of <c>IVec</c> + must be 64 bits (8 bytes).</p> + </desc> + </func> + <func> + <name>blowfish_cfb64_decrypt(Key, IVec, Text) -> Cipher</name> + <fsummary>Decrypt <c>Text</c>using Blowfish in CFB mode with 64 + bit feedback</fsummary> + <type> + <v>Key = Text = iolist() | binary()</v> + <v>IVec = Cipher = binary()</v> + </type> + <desc> + <p>Decrypts <c>Text</c> using Blowfish in CFB mode with 64 bit + feedback. <c>Key</c> is the Blowfish key, and <c>IVec</c> is an + arbitrary initializing vector. The length of <c>IVec</c> + must be 64 bits (8 bytes).</p> + </desc> + </func> + <func> + <name>aes_cfb_128_encrypt(Key, IVec, Text) -> Cipher</name> + <name>aes_cbc_128_encrypt(Key, IVec, Text) -> Cipher</name> + <fsummary>Encrypt <c>Text</c>according to AES in Cipher Feedback mode or Cipher Block Chaining mode</fsummary> + <type> + <v>Key = Text = iolist() | binary()</v> + <v>IVec = Cipher = binary()</v> + </type> + <desc> + <p>Encrypts <c>Text</c> according to AES in Cipher Feedback + mode (CFB) or Cipher Block Chaining mode (CBC). <c>Text</c> + must be a multiple of 128 bits (16 bytes). <c>Key</c> is the + AES key, and <c>IVec</c> is an arbitrary initializing vector. + The lengths of <c>Key</c> and <c>IVec</c> must be 128 bits + (16 bytes).</p> + </desc> + </func> + <func> + <name>aes_cfb_128_decrypt(Key, IVec, Cipher) -> Text</name> + <name>aes_cbc_128_decrypt(Key, IVec, Cipher) -> Text</name> + <fsummary>Decrypt <c>Cipher</c>according to AES in Cipher Feedback mode or Cipher Block Chaining mode</fsummary> + <type> + <v>Key = Cipher = iolist() | binary()</v> + <v>IVec = Text = binary()</v> + </type> + <desc> + <p>Decrypts <c>Cipher</c> according to Cipher Feedback Mode (CFB) + or Cipher Block Chaining mode (CBC). + <c>Key</c> is the AES key, and <c>IVec</c> is an arbitrary + initializing vector. <c>Key</c> and <c>IVec</c> must have + the same values as those used when encrypting. <c>Cipher</c> + must be a multiple of 128 bits (16 bytes). The lengths of + <c>Key</c> and <c>IVec</c> must be 128 bits (16 bytes).</p> + </desc> + </func> + <func> + <name>aes_cbc_ivec(Data) -> IVec</name> + <fsummary>Get <c>IVec</c> to be used in next iteration of + <c>aes_cbc_*_[ecrypt|decrypt]</c></fsummary> + <type> + <v>Data = iolist() | binary()</v> + <v>IVec = binary()</v> + </type> + <desc> + <p>Returns the <c>IVec</c> to be used in a next iteration of + <c>aes_cbc_*_[encrypt|decrypt]</c>. <c>Data</c> is the encrypted + data from the previous iteration step.</p> + </desc> + </func> + <func> + <name>erlint(Mpint) -> N</name> + <name>mpint(N) -> Mpint</name> + <fsummary>Convert between binary multi-precision integer and erlang big integer</fsummary> + <type> + <v>Mpint = binary()</v> + <v>N = integer()</v> + </type> + <desc> + <p>Convert a binary multi-precision integer <c>Mpint</c> to and from + an erlang big integer. A multi-precision integer is a binary + with the following form: + <c><![CDATA[<<ByteLen:32/integer, Bytes:ByteLen/binary>>]]></c> where both + <c>ByteLen</c> and <c>Bytes</c> are big-endian. Mpints are used in + some of the functions in <c>crypto</c> and are not translated + in the API for performance reasons.</p> + </desc> + </func> + <func> + <name>rand_bytes(N) -> binary()</name> + <fsummary>Generate a binary of random bytes</fsummary> + <type> + <v>N = integer()</v> + </type> + <desc> + <p>Generates N bytes randomly uniform 0..255, and returns the + result in a binary. Uses the <c>crypto</c> library pseudo-random + number generator.</p> + </desc> + </func> + <func> + <name>rand_uniform(Lo, Hi) -> N</name> + <fsummary>Generate a random number</fsummary> + <type> + <v>Lo, Hi, N = Mpint | integer()</v> + <v>Mpint = binary()</v> + </type> + <desc> + <p>Generate a random number <c><![CDATA[N, Lo =< N < Hi.]]></c> Uses the + <c>crypto</c> library pseudo-random number generator. The + arguments (and result) can be either erlang integers or binary + multi-precision integers.</p> + </desc> + </func> + <func> + <name>mod_exp(N, P, M) -> Result</name> + <fsummary>Perform N ^ P mod M</fsummary> + <type> + <v>N, P, M, Result = Mpint</v> + <v>Mpint = binary()</v> + </type> + <desc> + <p>This function performs the exponentiation <c>N ^ P mod M</c>, + using the <c>crypto</c> library.</p> + </desc> + </func> + + <func> + <name>rsa_sign(Data, Key) -> Signature</name> + <name>rsa_sign(DigestType, Data, Key) -> Signature</name> + <fsummary>Sign the data using rsa with the given key.</fsummary> + <type> + <v>Data = Mpint</v> + <v>Key = [E, N, D]</v> + <v>E, N, D = Mpint</v> + <d>Where <c>E</c> is the public exponent, <c>N</c> is public modulus and + <c>D</c> is the private exponent.</d> + <v>DigestType = md5 | sha</v> + <d>The default <c>DigestType</c> is sha.</d> + <v>Mpint = binary()</v> + <v>Signature = binary()</v> + </type> + <desc> + <p>Calculates a <c>DigestType</c> digest of the <c>Data</c> + and creates a RSA signature with the private key <c>Key</c> + of the digest.</p> + </desc> + </func> + + <func> + <name>rsa_verify(Data, Signature, Key) -> Verified</name> + <name>rsa_verify(DigestType, Data, Signature, Key) -> Verified </name> + <fsummary>Verify the digest and signature using rsa with given public key.</fsummary> + <type> + <v>Verified = boolean()</v> + <v>Data, Signature = Mpint</v> + <v>Key = [E, N]</v> + <v>E, N = Mpint</v> + <d>Where <c>E</c> is the public exponent and <c>N</c> is public modulus.</d> + <v>DigestType = md5 | sha</v> + <d> The default <c>DigestType</c> is sha.</d> + <v>Mpint = binary()</v> + </type> + <desc> + <p>Calculates a <c>DigestType</c> digest of the <c>Data</c> + and verifies that the digest matches the RSA signature using the + signer's public key <c>Key</c>. + </p> + </desc> + </func> + + <func> + <name>rsa_public_encrypt(PlainText, PublicKey, Padding) -> ChipherText</name> + <fsummary>Encrypts Msg using the public Key.</fsummary> + <type> + <v>PlainText = binary()</v> + <v>PublicKey = [E, N]</v> + <v>E, N = Mpint</v> + <d>Where <c>E</c> is the public exponent and <c>N</c> is public modulus.</d> + <v>Padding = rsa_pkcs1_padding | rsa_pkcs1_oaep_padding | rsa_no_padding</v> + <v>ChipherText = binary()</v> + </type> + <desc> + <p>Encrypts the <c>PlainText</c> (usually a session key) using the <c>PublicKey</c> + and returns the cipher. The <c>Padding</c> decides what padding mode is used, + <c>rsa_pkcs1_padding</c> is PKCS #1 v1.5 currently the most + used mode and <c>rsa_pkcs1_oaep_padding</c> is EME-OAEP as + defined in PKCS #1 v2.0 with SHA-1, MGF1 and an empty encoding + parameter. This mode is recommended for all new applications. + The size of the <c>Msg</c> must be less + than <c>byte_size(N)-11</c> if + <c>rsa_pkcs1_padding</c> is used, <c>byte_size(N)-41</c> if + <c>rsa_pkcs1_oaep_padding</c> is used and <c>byte_size(N)</c> if <c>rsa_no_padding</c> + is used. + Where byte_size(N) is the size part of an <c>Mpint-1</c>. + </p> + </desc> + </func> + + <func> + <name>rsa_private_decrypt(ChipherText, PrivateKey, Padding) -> PlainText</name> + <fsummary>Decrypts ChipherText using the private Key.</fsummary> + <type> + <v>ChipherText = binary()</v> + <v>PrivateKey = [E, N, D]</v> + <v>E, N, D = Mpint</v> + <d>Where <c>E</c> is the public exponent, <c>N</c> is public modulus and + <c>D</c> is the private exponent.</d> + <v>Padding = rsa_pkcs1_padding | rsa_pkcs1_oaep_padding | rsa_no_padding</v> + <v>PlainText = binary()</v> + </type> + <desc> + <p>Decrypts the <c>ChipherText</c> (usually a session key encrypted with + <seealso marker="#rsa_public_encrypt/3">rsa_public_encrypt/3</seealso>) + using the <c>PrivateKey</c> and returns the + message. The <c>Padding</c> is the padding mode that was + used to encrypt the data, + see <seealso marker="#rsa_public_encrypt/3">rsa_public_encrypt/3</seealso>. + </p> + </desc> + </func> + <func> + <name>rsa_private_encrypt(PlainText, PrivateKey, Padding) -> ChipherText</name> + <fsummary>Encrypts Msg using the private Key.</fsummary> + <type> + <v>PlainText = binary()</v> + <v>PrivateKey = [E, N, D]</v> + <v>E, N, D = Mpint</v> + <d>Where <c>E</c> is the public exponent, <c>N</c> is public modulus and + <c>D</c> is the private exponent.</d> + <v>Padding = rsa_pkcs1_padding | rsa_no_padding</v> + <v>ChipherText = binary()</v> + </type> + <desc> + <p>Encrypts the <c>PlainText</c> using the <c>PrivateKey</c> + and returns the cipher. The <c>Padding</c> decides what padding mode is used, + <c>rsa_pkcs1_padding</c> is PKCS #1 v1.5 currently the most + used mode. + The size of the <c>Msg</c> must be less than <c>byte_size(N)-11</c> if + <c>rsa_pkcs1_padding</c> is used, and <c>byte_size(N)</c> if <c>rsa_no_padding</c> + is used. Where byte_size(N) is the size part of an <c>Mpint-1</c>. + </p> + </desc> + </func> + + <func> + <name>rsa_public_decrypt(ChipherText, PublicKey, Padding) -> PlainText</name> + <fsummary>Decrypts ChipherText using the public Key.</fsummary> + <type> + <v>ChipherText = binary()</v> + <v>PublicKey = [E, N]</v> + <v>E, N = Mpint</v> + <d>Where <c>E</c> is the public exponent and <c>N</c> is public modulus</d> + <v>Padding = rsa_pkcs1_padding | rsa_no_padding</v> + <v>PlainText = binary()</v> + </type> + <desc> + <p>Decrypts the <c>ChipherText</c> (encrypted with + <seealso marker="#rsa_private_encrypt/3">rsa_private_encrypt/3</seealso>) + using the <c>PrivateKey</c> and returns the + message. The <c>Padding</c> is the padding mode that was + used to encrypt the data, + see <seealso marker="#rsa_private_encrypt/3">rsa_private_encrypt/3</seealso>. + </p> + </desc> + </func> + + <func> + <name>dss_sign(Data, Key) -> Signature</name> + <fsummary>Sign the data using dsa with given private key.</fsummary> + <type> + <v>Digest = Mpint</v> + <v>Key = [P, Q, G, X]</v> + <v>P, Q, G, X = Mpint</v> + <d> Where <c>P</c>, <c>Q</c> and <c>G</c> are the dss + parameters and <c>X</c> is the private key.</d> + <v>Mpint = binary()</v> + <v>Signature = binary()</v> + </type> + <desc> + <p>Calculates the sha digest of the <c>Data</c> + and creates a DSS signature with the private key <c>Key</c> + of the digest.</p> + </desc> + </func> + + <func> + <name>dss_verify(Data, Signature, Key) -> Verified</name> + <fsummary>Verify the data and signature using dsa with given public key.</fsummary> + <type> + <v>Verified = boolean()</v> + <v>Digest, Signature = Mpint</v> + <v>Key = [P, Q, G, Y]</v> + <v>P, Q, G, Y = Mpint</v> + <d> Where <c>P</c>, <c>Q</c> and <c>G</c> are the dss + parameters and <c>Y</c> is the public key.</d> + <v>Mpint = binary()</v> + </type> + <desc> + <p>Calculates the sha digest of the <c>Data</c> and verifies that the + digest matches the DSS signature using the public key <c>Key</c>. + </p> + </desc> + </func> + + <func> + <name>rc4_encrypt(Key, Data) -> Result</name> + <fsummary>Encrypt data using RC4</fsummary> + <type> + <v>Key, Data = iolist() | binary()</v> + <v>Result = binary()</v> + </type> + <desc> + <p>Encrypts the data with RC4 symmetric stream encryption. + Since it is symmetric, the same function is used for + decryption.</p> + </desc> + </func> + + <func> + <name>dh_generate_key(DHParams) -> {PublicKey,PrivateKey} </name> + <name>dh_generate_key(PrivateKey, DHParams) -> {PublicKey,PrivateKey} </name> + <fsummary>Generates a Diffie-Hellman public key</fsummary> + <type> + <v>DHParameters = [P, G]</v> + <v>P, G = Mpint</v> + <d> Where <c>P</c> is the shared prime number and <c>G</c> is the shared generator.</d> + <v>PublicKey, PrivateKey = Mpint()</v> + </type> + <desc> + <p>Generates a Diffie-Hellman <c>PublicKey</c> and <c>PrivateKey</c> (if not given). + </p> + </desc> + </func> + + <func> + <name>dh_compute_key(OthersPublicKey, MyPrivateKey, DHParams) -> SharedSecret</name> + <fsummary>Computes the shared secret</fsummary> + <type> + <v>DHParameters = [P, G]</v> + <v>P, G = Mpint</v> + <d> Where <c>P</c> is the shared prime number and <c>G</c> is the shared generator.</d> + <v>OthersPublicKey, MyPrivateKey = Mpint()</v> + <v>SharedSecret = binary()</v> + </type> + <desc> + <p>Computes the shared secret from the private key and the other party's public key. + </p> + </desc> + </func> + + + <func> + <name>exor(Data1, Data2) -> Result</name> + <fsummary>XOR data</fsummary> + <type> + <v>Data1, Data2 = iolist() | binary()</v> + <v>Result = binary()</v> + </type> + <desc> + <p>Performs bit-wise XOR (exclusive or) on the data supplied.</p> + </desc> + </func> + </funcs> + + <section> + <title>DES in CBC mode</title> + <p>The Data Encryption Standard (DES) defines an algorithm for + encrypting and decrypting an 8 byte quantity using an 8 byte key + (actually only 56 bits of the key is used). + </p> + <p>When it comes to encrypting and decrypting blocks that are + multiples of 8 bytes various modes are defined (NIST SP + 800-38A). One of those modes is the Cipher Block Chaining (CBC) + mode, where the encryption of an 8 byte segment depend not only + of the contents of the segment itself, but also on the result of + encrypting the previous segment: the encryption of the previous + segment becomes the initializing vector of the encryption of the + current segment. + </p> + <p>Thus the encryption of every segment depends on the encryption + key (which is secret) and the encryption of the previous + segment, except the first segment which has to be provided with + an initial initializing vector. That vector could be chosen at + random, or be a counter of some kind. It does not have to be + secret. + </p> + <p>The following example is drawn from the old FIPS 81 standard + (replaced by NIST SP 800-38A), where both the plain text and the + resulting cipher text is settled. The following code fragment + returns `true'. + </p> + <pre><![CDATA[ + + Key = <<16#01,16#23,16#45,16#67,16#89,16#ab,16#cd,16#ef>>, + IVec = <<16#12,16#34,16#56,16#78,16#90,16#ab,16#cd,16#ef>>, + P = "Now is the time for all ", + C = crypto:des_cbc_encrypt(Key, IVec, P), + % Which is the same as + P1 = "Now is t", P2 = "he time ", P3 = "for all ", + C1 = crypto:des_cbc_encrypt(Key, IVec, P1), + C2 = crypto:des_cbc_encrypt(Key, C1, P2), + C3 = crypto:des_cbc_encrypt(Key, C2, P3), + + C = <<C1/binary, C2/binary, C3/binary>>, + C = <<16#e5,16#c7,16#cd,16#de,16#87,16#2b,16#f2,16#7c, + 16#43,16#e9,16#34,16#00,16#8c,16#38,16#9c,16#0f, + 16#68,16#37,16#88,16#49,16#9a,16#7c,16#05,16#f6>>, + <<"Now is the time for all ">> == + crypto:des_cbc_decrypt(Key, IVec, C). + ]]></pre> + <p>The following is true for the DES CBC mode. For all + decompositions <c>P1 ++ P2 = P</c> of a plain text message + <c>P</c> (where the length of all quantities are multiples of 8 + bytes), the encryption <c>C</c> of <c>P</c> is equal to <c>C1 ++ + C2</c>, where <c>C1</c> is obtained by encrypting <c>P1</c> with + <c>Key</c> and the initializing vector <c>IVec</c>, and where + <c>C2</c> is obtained by encrypting <c>P2</c> with <c>Key</c> + and the initializing vector <c>last8(C1)</c>, + where <c>last(Binary)</c> denotes the last 8 bytes of the + binary <c>Binary</c>. + </p> + <p>Similarly, for all decompositions <c>C1 ++ C2 = C</c> of a + cipher text message <c>C</c> (where the length of all quantities + are multiples of 8 bytes), the decryption <c>P</c> of <c>C</c> + is equal to <c>P1 ++ P2</c>, where <c>P1</c> is obtained by + decrypting <c>C1</c> with <c>Key</c> and the initializing vector + <c>IVec</c>, and where <c>P2</c> is obtained by decrypting + <c>C2</c> with <c>Key</c> and the initializing vector + <c>last8(C1)</c>, where <c>last8(Binary)</c> is as above. + </p> + <p>For DES3 (which uses three 64 bit keys) the situation is the + same. + </p> + </section> +</erlref> + diff --git a/lib/crypto/doc/src/crypto_app.xml b/lib/crypto/doc/src/crypto_app.xml new file mode 100644 index 0000000000..bf1d1ae1f7 --- /dev/null +++ b/lib/crypto/doc/src/crypto_app.xml @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE appref SYSTEM "appref.dtd"> + +<appref> + <header> + <copyright> + <year>1999</year> + <year>2007</year> + <holder>Ericsson AB, All Rights Reserved</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + The Initial Developer of the Original Code is Ericsson AB. + </legalnotice> + + <title>crypto</title> + <prepared>Peter Högfeldt</prepared> + <responsible>Peter Högfeldt</responsible> + <docno></docno> + <approved>Peter Högfeldt</approved> + <checked>Peter Högfeldt</checked> + <date>2003-06-01</date> + <rev>B</rev> + <file>crypto_app.sgml</file> + </header> + <app>crypto</app> + <appsummary>The Crypto Application</appsummary> + <description> + <p>The purpose of the Crypto application is to provide message + digest and DES encryption for SMNPv3. It provides computation of + message digests MD5 and SHA, and CBC-DES encryption and + decryption.</p> + <p></p> + </description> + + <section> + <title>Configuration</title> + <p>The following environment configuration parameters are defined + for the Crypto application. Refer to application(3) for more + information about configuration parameters. + </p> + <taglist> + <tag><c><![CDATA[debug = true | false <optional>]]></c></tag> + <item> + <p>Causes debug information to be written to standard + error or standard output. Default is <c>false</c>. + </p> + </item> + </taglist> + </section> + + <section> + <title>OpenSSL libraries</title> + <p>The current implementation of the Erlang Crypto application is + based on the <em>OpenSSL</em> package version 0.9.7 or higher. + There are source and binary releases on the web. + </p> + <p>Source releases of OpenSSL can be downloaded from the <url href="http://www.openssl.org">OpenSSL</url> project home page, + or mirror sites listed there. + </p> + <p>The same URL also contains links to some compiled binaries and + libraries of OpenSSL (see the <c>Related/Binaries</c> menu) of + which the <url href="http://www.shininglightpro.com/search.php?searchname=Win32+OpenSSL">Shining Light Productions Win32 and OpenSSL</url> pages are of + interest for the Win32 user. + </p> + <p>For some Unix flavours there are binary packages available + on the net. + </p> + <p>If you cannot find a suitable binary OpenSSL package, you + have to fetch an OpenSSL source release and compile it. + </p> + <p>You then have to compile and install the library + <c>libcrypto.so</c> (Unix), or the library <c>libeay32.dll</c> + (Win32). + </p> + <p>For Unix The <c>crypto_drv</c> dynamic driver is delivered linked + to OpenSSL libraries in <c>/usr/local/lib</c>, but the default + dynamic linking will also accept libraries in <c>/lib</c> and + <c>/usr/lib</c>. + </p> + <p>If that is not applicable to the particular Unix operating + system used, the example <c>Makefile</c> in the Crypto + <c>priv/obj</c> directory, should be used as a basis for + relinking the final version of the port program. + </p> + <p>For <c>Win32</c> it is only required that the library can be + found from the <c>PATH</c> environment variable, or that they + reside in the appropriate <c>SYSTEM32</c> directory; hence no + particular relinking is need. Hence no example <c>Makefile</c> + for Win32 is provided.</p> + </section> + + <section> + <title>SEE ALSO</title> + <p>application(3)</p> + </section> +</appref> + diff --git a/lib/crypto/doc/src/fascicules.xml b/lib/crypto/doc/src/fascicules.xml new file mode 100644 index 0000000000..8fc250bc75 --- /dev/null +++ b/lib/crypto/doc/src/fascicules.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE fascicules SYSTEM "fascicules.dtd"> + +<fascicules> + <fascicule file="usersguide" href="usersguide_frame.html" entry="no"> + User's Guide + </fascicule> + <fascicule file="ref_man" href="ref_man_frame.html" entry="yes"> + Reference Manual + </fascicule> + <fascicule file="release_notes" href="release_notes_frame.html" entry="no"> + Release Notes + </fascicule> + <fascicule file="" href="../../../../doc/print.html" entry="no"> + Off-Print + </fascicule> +</fascicules> + diff --git a/lib/crypto/doc/src/insidecover.xml b/lib/crypto/doc/src/insidecover.xml new file mode 100644 index 0000000000..e7407b8052 --- /dev/null +++ b/lib/crypto/doc/src/insidecover.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE bookinsidecover SYSTEM "bookinsidecover.dtd"> + +<bookinsidecover> + + The Erlang/OTP SSL application includes software developed by the + OpenSSL Project for use in the OpenSSL Toolkit + (http://www.openssl.org/). Copyright (c) 1998-2002 The OpenSSL + Project. All rights reserved. + + <br/> + This product includes cryptographic software written by Eric Young + ([email protected]). This product includes software written by Tim + Hudson ([email protected]). Copyright (C) 1995-1998 Eric Young + ([email protected]). All rights reserved. + + <br/> + For further OpenSSL and SSLeay license information se the chapter + <bold>Licenses</bold>. + + <vfill/> + <br/> + <tt>http://www.erlang.org</tt> + <br/> +</bookinsidecover> + diff --git a/lib/crypto/doc/src/licenses.xml b/lib/crypto/doc/src/licenses.xml new file mode 100644 index 0000000000..bae87a373e --- /dev/null +++ b/lib/crypto/doc/src/licenses.xml @@ -0,0 +1,155 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE chapter SYSTEM "chapter.dtd"> + +<chapter> + <header> + <copyright> + <year>2003</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>Licenses</title> + <prepared>Peter Högfeldt</prepared> + <docno></docno> + <date>2003-05-26</date> + <rev>A</rev> + <file>licenses.xml</file> + </header> + <p> <marker id="licenses"></marker> +This chapter contains in extenso versions + of the OpenSSL and SSLeay licenses. + </p> + + <section> + <title>OpenSSL License</title> + <code type="none"> +/* ==================================================================== + * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * [email protected]. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * ([email protected]). This product includes software written by Tim + * Hudson ([email protected]). + * + */ </code> + </section> + + <section> + <title>SSLeay License</title> + <code type="none"> +/* Copyright (C) 1995-1998 Eric Young ([email protected]) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young ([email protected]). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson ([email protected]). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young ([email protected])" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson ([email protected])" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ </code> + </section> +</chapter> + diff --git a/lib/crypto/doc/src/make.dep b/lib/crypto/doc/src/make.dep new file mode 100644 index 0000000000..73b090bbb6 --- /dev/null +++ b/lib/crypto/doc/src/make.dep @@ -0,0 +1,20 @@ +# ---------------------------------------------------- +# >>>> Do not edit this file <<<< +# This file was automaticly generated by +# /home/otp/bin/docdepend +# ---------------------------------------------------- + + +# ---------------------------------------------------- +# TeX files that the DVI file depend on +# ---------------------------------------------------- + +book.dvi: book.tex crypto.tex crypto_app.tex licenses.tex \ + ref_man.tex usersguide.tex + +# ---------------------------------------------------- +# Source inlined when transforming from source to LaTeX +# ---------------------------------------------------- + +book.tex: ref_man.xml + diff --git a/lib/crypto/doc/src/note.gif b/lib/crypto/doc/src/note.gif Binary files differnew file mode 100644 index 0000000000..6fffe30419 --- /dev/null +++ b/lib/crypto/doc/src/note.gif diff --git a/lib/crypto/doc/src/notes.xml b/lib/crypto/doc/src/notes.xml new file mode 100644 index 0000000000..bbdd2d873b --- /dev/null +++ b/lib/crypto/doc/src/notes.xml @@ -0,0 +1,469 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE chapter SYSTEM "chapter.dtd"> + +<chapter> + <header> + <copyright> + <year>1999</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>Crypto Release Notes</title> + <prepared>Peter Högfeldt</prepared> + <docno></docno> + <date>2003-06-06</date> + <rev>B</rev> + <file>notes.xml</file> + </header> + <p>This document describes the changes made to the Crypto application.</p> + +<section><title>Crypto 1.6.3</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + Suppressed false valgrind errors caused by libcrypto + using uninitialized data as entropy.</p> + <p> + Own Id: OTP-8200</p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + The documentation is now built with open source tools + (xsltproc and fop) that exists on most platforms. One + visible change is that the frames are removed.</p> + <p> + Own Id: OTP-8201</p> + </item> + <item> + <p> + When the crypto application failed to load the + OpenSSL/LibEAY shared object, error indication was + sparse. Now a more specific error message is sent to the + error logger.</p> + <p> + Own Id: OTP-8281</p> + </item> + </list> + </section> + +</section> + +<section><title>Crypto 1.6.2</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + Fixed emulator crash caused by crypto using an old + openssl version that did not cope with large file + descriptors.</p> + <p> + Own Id: OTP-8261 Aux Id: seq11434 </p> + </item> + </list> + </section> + +</section> + +<section><title>Crypto 1.6.1</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + <c>Makefile.in</c> has been updated to use the LDFLAGS + environment variable (if set). (Thanks to Davide + Pesavento.)</p> + <p> + Own Id: OTP-8157</p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Support for Blowfish cfb64 added to <c>crypto</c>.</p> + <p> + Own Id: OTP-8096</p> + </item> + <item> + <p> + New function <c>crypto:aes_cbc_ivec</c></p> + <p> + Own Id: OTP-8141</p> + </item> + </list> + </section> + +</section> + +<section><title>Crypto 1.6</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + The <c>dh_compute_key</c> sometimes returned a + SharedSecret of incorrect size.</p> + <p> + Own Id: OTP-7674</p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Optimization for drivers by creating small binaries + direct on process heap.</p> + <p> + Own Id: OTP-7762</p> + </item> + </list> + </section> + +</section> + +<section><title>Crypto 1.5.3</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Added new functions: dss_verify/3, rsa_verify/3, + rsa_verify/4, dss_sign/2, rsa_sign/2, rsa_sign/3, + rsa_public_encrypt, rsa_private_decrypt/3, + rsa_private_encrypt/3, rsa_public_decrypt/3, + dh_generate_key/1, dh_generate_key/2, dh_compute_key/3.</p> + <p> + Own Id: OTP-7545</p> + </item> + </list> + </section> + +</section> + +<section><title>Crypto 1.5.2.1</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Minor performance optimization.</p> + <p> + Own Id: OTP-7521</p> + </item> + </list> + </section> + +</section> + +<section><title>Crypto 1.5.2</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + ./configure has been improved to find 64-bit OpenSSL + libraries.</p> + <p> + Own Id: OTP-7270</p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + crypto and zlib drivers improved to allow concurent smp + access.</p> + <p> + Own Id: OTP-7262</p> + </item> + </list> + </section> + +</section> + + <section> + <title>Crypto 1.5.1.1</title> + + <section> + <title>Improvements and New Features</title> + <list type="bulleted"> + <item> + <p>The linked in driver for the crypto application is now + linked statically against the OpenSSL libraries, to avoid + installation and runtime problems in connection to the + OpenSSL library locations.</p> + <p>Own Id: OTP-6680</p> + </item> + <item> + <p>Minor Makefile changes.</p> + <p>Own Id: OTP-6689</p> + </item> + </list> + </section> + </section> + + <section> + <title>Crypto 1.5</title> + + <section> + <title>Improvements and New Features</title> + <list type="bulleted"> + <item> + <p>It is now explicitly checked at start-up that the crypto + driver is properly loaded (Thanks to Claes Wikstrom).</p> + <p>Own Id: OTP-6109</p> + </item> + </list> + </section> + </section> + + <section> + <title>Crypto 1.4</title> + + <section> + <title>Improvements and New Features</title> + <list type="bulleted"> + <item> + <p>The previously undocumented and UNSUPPORTED <c>ssh</c> + application has been updated and documented. This release + of the <c>ssh</c> application is still considered to be a + beta release and (if necessary) there could still be + changes in its API before it reaches 1.0.</p> + <p>Also, more cryptographic algorithms have been added to + the <c>crypto</c> application.</p> + <p>*** POTENTIAL INCOMPATIBILITY ***</p> + <p>Own Id: OTP-5631</p> + </item> + </list> + </section> + </section> + + <section> + <title>Crypto 1.3</title> + + <section> + <title>Improvements and New Features</title> + <list type="bulleted"> + <item> + <p>Added support for RFC 3826 - The Advanced Encryption Standard + (AES) Cipher Algorithm in the SNMP User-based Security Model. + <br></br> +Martin Björklund</p> + </item> + </list> + </section> + </section> + + <section> + <title>Crypto 1.2.3</title> + + <section> + <title>Fixed Bugs and Malfunctions</title> + <list type="bulleted"> + <item> + <p>Linked in drivers in the crypto, and asn1 applications + are now compiled with the -D_THREAD_SAFE and -D_REENTRANT + switches on unix when the emulator has thread support + enabled.</p> + <p>Linked in drivers on MacOSX are not compiled with the + undocumented -lbundle1.o switch anymore. Thanks to Sean + Hinde who sent us a patch.</p> + <p>Linked in driver in crypto, and port programs in ssl, now + compiles on OSF1.</p> + <p>Minor makefile improvements in runtime_tools.</p> + <p>Own Id: OTP-5346</p> + </item> + </list> + </section> + </section> + + <section> + <title>Crypto 1.2.2</title> + + <section> + <title>Improvements and New Features</title> + <list type="bulleted"> + <item> + <p>Corrected error handling. If the port to the driver that + crypto uses is unexpectedly closed (which should not + happen during normal operation of crypto), crypto will + terminate immediately (rather than crashing the next time + crypto is used). Also corrected build problems on Mac OS + X.</p> + <p>Own Id: OTP-5279</p> + </item> + </list> + </section> + </section> + + <section> + <title>Crypto 1.2.1</title> + + <section> + <title>Fixed Bugs and Malfunctions</title> + <list type="bulleted"> + <item> + <p>It was not possible in R9 to relink the crypto driver. + The object file was missing as well as an example + makefile. The crypto driver object file is now released + with the application (installed in priv/obj). An example + makefile has also been added to the priv/obj directory. + The makefile serves as an example of how to relink the + driver on Unix (crypto_drv.so) or Windows + (crypto_drv.dll).</p> + <p>Own Id: OTP-4828 Aux Id: seq8193 </p> + </item> + </list> + </section> + </section> + + <section> + <title>Crypto 1.2</title> + + <section> + <title>Improvements and New Features</title> + <list type="bulleted"> + <item> + <p>Previous versions of Crypto where delivered with + statically linked binaries based on SSLeay. That is not + longer the case. The current version of Crypto requires + dynamically linked OpenSSL libraries that the user has to + install. The library needed is <c>libcrypto.so</c> (Unix) + or <c>libeay32.[lib|dll]</c> (Win32). For further details + see the crypto(6) application manual page.</p> + </item> + <item> + <p>This version of Crypto uses the new DES interface of + OpenSSL 0.9.7, which is not backward compatible with + earlier versions of OpenSSL. + </p> + </item> + <item>The functions <c>des_ede3_cbc_encrypt/5</c> and + <c>des_ede3_cbc_decrypt/5</c> have been renamed to + <c>des3_cbc_encrypt/5</c> and <c>des3_cbc_decrypt/5</c>, + respectively. The old functions have been retained (they are + deprecated and not listed in the crypto(3) manual page).</item> + </list> + </section> + + <section> + <title>Reported Fixed Bugs and Malfunctions</title> + <list type="bulleted"> + <item> + <p>The start of crypto failed on Windows, due to erroneous addition + of a DES3 algorithm.</p> + <p>Own Id: OTP-4684 + <br></br> +Aux Id: seq7864</p> + </item> + </list> + </section> + </section> + + <section> + <title>Crypto 1.1.3</title> + + <section> + <title>Reported Fixed Bugs and Malfunctions</title> + <list type="bulleted"> + <item>To obtain backward compatibility with the old SSLeay + package, and with earlier versions of OpenSSL, the macro + OPENSSL_DES_LIBDES_COMPATIBILITY has been added to + <c>crypto_drv.c</c>. This is of importance only for the open + source version of Crypto. + </item> + </list> + </section> + </section> + + <section> + <title>Crypto 1.1.2</title> + + <section> + <title>Reported Fixed Bugs and Malfunctions</title> + <list type="bulleted"> + <item> + <p>In the manual page <c>crypto(3)</c> the function names + <c>md5_finish</c> and <c>sha_finish</c> have been changed to + <c>md5_final</c> and <c>sha_final</c> to correctly document + the implementation.</p> + <p>Own Id: OTP-3409 + </p> + </item> + </list> + </section> + </section> + + <section> + <title>Crypto 1.1.1</title> + <p>Code replacement in runtime is supported. Upgrade can be done from + from version 1.1 and downgrade to version 1.1. + </p> + + <section> + <title>Improvements and New Features</title> + <list type="bulleted"> + <item> + <p>The driver part of the Crypto application has been + updated to use the erl_driver header file. Version 1.1.1 + requires emulator version 4.9.1 or later.</p> + </item> + </list> + </section> + </section> + + <section> + <title>Crypto 1.1</title> + + <section> + <title>Reported Fixed Bugs and Malfunctions</title> + <list type="bulleted"> + <item> + <p>On Windows the crypto_drv was incorrectly linked to + static run-time libraries instead of dynamic ones.</p> + <p>Own Id: OTP-3240 + </p> + </item> + </list> + </section> + </section> + + <section> + <title>Crypto 1.0</title> + <p>New application. + </p> + </section> +</chapter> + diff --git a/lib/crypto/doc/src/ref_man.xml b/lib/crypto/doc/src/ref_man.xml new file mode 100644 index 0000000000..f801221c81 --- /dev/null +++ b/lib/crypto/doc/src/ref_man.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE application SYSTEM "application.dtd"> + +<application xmlns:xi="http://www.w3.org/2001/XInclude"> + <header> + <copyright> + <year>1999</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>Crypto Reference Manual</title> + <prepared>Peter Högfeldt</prepared> + <docno></docno> + <date>2003-06-01</date> + <rev>B</rev> + <file>refman.sgml</file> + </header> + <description> + <p>The Crypto Application provides functions for computation of + message digests, and encryption and decryption functions. + </p> + <p>This product includes software developed by the OpenSSL Project for + use in the OpenSSL Toolkit (http://www.openssl.org/). + </p> + <p>This product includes cryptographic software written by Eric Young + ([email protected]). + </p> + <p>This product includes software written by Tim Hudson + ([email protected]). + </p> + <p>For full OpenSSL and SSLeay license texts, see <seealso marker="licenses#licenses">Licenses</seealso>.</p> + </description> + <xi:include href="crypto_app.xml"/> + <xi:include href="crypto.xml"/> +</application> + diff --git a/lib/crypto/doc/src/release_notes.xml b/lib/crypto/doc/src/release_notes.xml new file mode 100644 index 0000000000..0c2ee23e22 --- /dev/null +++ b/lib/crypto/doc/src/release_notes.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE part SYSTEM "part.dtd"> + +<part> + <header> + <copyright> + <year>1999</year> + <year>2007</year> + <holder>Ericsson AB, All Rights Reserved</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + The Initial Developer of the Original Code is Ericsson AB. + </legalnotice> + + <title>Crypto Release Notes</title> + <prepared>Peter Hjögfeldt</prepared> + <docno></docno> + <date>2003-06-01</date> + <rev>B</rev> + <file>release_notes.sgml</file> + </header> + <description> + <p>The Crypto Application provides functions for computation of + message digests, and encryption and decryption functions. + </p> + <p>This product includes software developed by the OpenSSL Project for + use in the OpenSSL Toolkit (http://www.openssl.org/). + </p> + <p>This product includes cryptographic software written by Eric Young + ([email protected]). + </p> + <p>This product includes software written by Tim Hudson + ([email protected]). + </p> + <p>For full OpenSSL and SSLeay license texts, see <seealso marker="licenses#licenses">Licenses</seealso>.</p> + </description> + <include file="notes"></include> +</part> + diff --git a/lib/crypto/doc/src/usersguide.xml b/lib/crypto/doc/src/usersguide.xml new file mode 100644 index 0000000000..dc5bf520a9 --- /dev/null +++ b/lib/crypto/doc/src/usersguide.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE part SYSTEM "part.dtd"> + +<part xmlns:xi="http://www.w3.org/2001/XInclude"> + <header> + <copyright> + <year>2003</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>Crypto User's Guide</title> + <prepared>OTP Team</prepared> + <docno></docno> + <date>2003-06-01</date> + <rev>C</rev> + <file>usersguide.sgml</file> + </header> + <description> + <p>The <em>Crypto</em> application provides functions for + computation of message digests, and functions for encryption and + decryption. + </p> + <p>This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/). + </p> + <p>This product includes cryptographic software written by Eric + Young ([email protected]). + </p> + <p>This product includes software written by Tim Hudson + ([email protected]). + </p> + <p>For full OpenSSL and SSLeay license texts, see <seealso marker="licenses#licenses">Licenses</seealso>. + </p> + </description> + <xi:include href="licenses.xml"/> +</part> + diff --git a/lib/crypto/doc/src/warning.gif b/lib/crypto/doc/src/warning.gif Binary files differnew file mode 100644 index 0000000000..96af52360e --- /dev/null +++ b/lib/crypto/doc/src/warning.gif |