From d8144ef38f7e18230349100bbdee1da4c723fd94 Mon Sep 17 00:00:00 2001 From: Andreas Schultz Date: Wed, 12 Sep 2012 20:57:01 +0200 Subject: CRYPTO: add support for RFC-2945 SRP-3 and RFC-5054 SRP-6a authentication --- lib/crypto/doc/src/crypto.xml | 88 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 87 insertions(+), 1 deletion(-) (limited to 'lib/crypto/doc/src/crypto.xml') diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml index 6b9b2ef207..d4224e773c 100755 --- a/lib/crypto/doc/src/crypto.xml +++ b/lib/crypto/doc/src/crypto.xml @@ -973,7 +973,17 @@ Mpint() = >]]> using the crypto library.

- + + mod_exp_prime(N, P, M) -> Result + Computes the function: N^P mod M + + N, P, M = binary() + Result = binary() | error + + +

Computes the function N^P mod M.

+
+
rsa_sign(DataOrDigest, Key) -> Signature rsa_sign(DigestType, DataOrDigest, Key) -> Signature @@ -1256,6 +1266,82 @@ Mpint() = >]]> + + srp_value_B(Multiplier, Verifier, Generator, Exponent, Prime) -> ValueB + Computes the SRP function: B = k*v + g^b % N + + Verifier (v), Generator (g), Exponent (b), Prime (N), ValueB (B) = binary() + Multiplier (k) = integer() | binary() + + +

Computes the SRP value B according to RFC-2945, Sect. 3 and RFC-5054, Sect. 2.5.3

+

B = k*v + g^b % N

+
+
+ + + srp_client_secret(A, U, B, Multiplier, Generator, Exponent, Prime) -> Secret + Computes the SRP client secret + + A (a), U (u), B, Multiplier (k), Generator (g), Exponent (x), Prime (N), Secret = binary() + Multiplier (k) = integer() | binary() + + +

Computes the SRP client secret according to RFC-2945, Sect. 3 and RFC-5054, Sect. 2.6

+

Secret = (B - (k * g^x)) ^ (a + (u * x)) % N

+
+
+ + + srp_server_secret(Verifier, B, U, A, Prime) -> Secret + Computes the SRP host secret + + Verifier (v), B (b), U (u), A, Prime (N), Secret = binary() + + +

Computes the SRP host secret according to RFC-2945, Sect. 3 and RFC-5054, Sect. 2.6

+

Secret = (A * v^u) ^ b % N

+
+
+ + + srp3_value_u(B) -> Result + Computes the SRP3-SHA value u + + B = binary() + Result = integer() + + +

Computes the SRP-3 value u according to RFC-2945, Sect. 3 +

+
+
+ + + srp6_value_u(A, B, Prime) -> Result + Computes the SRP6a value u as u = SHA1(PAD(A) | PAD(B)) + + A, B, Prime = binary() + Result = integer() + + +

Computes the SRP-6 value u according to RFC-5054, Sect. 2.6 +

+
+
+ + + srp6a_multiplier(Generator, Prime) -> Result + Computes the SRP-SHA function: k = SHA1(N | PAD(g)) + + Generator, Prime = binary() + Result = integer() + + +

Computes the SRP-6a function SHA1(N | PAD(g)) as the multiplier +

+
+
exor(Data1, Data2) -> Result -- cgit v1.2.3 From 71f8eb83a9088ebedc2b557ae7f86b3db71d1a13 Mon Sep 17 00:00:00 2001 From: Andreas Schultz Date: Tue, 19 Feb 2013 17:36:57 +0100 Subject: CRYPTO: add algorithms/0 function that returns a list off compiled in crypto algorithms add algorithms/0 function that returns a list off compiled in crypto algorithms and make tests suites with SHA226, SHA256, SHA384 and SHA512 conditional based on that --- lib/crypto/doc/src/crypto.xml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/crypto/doc/src/crypto.xml') diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml index d4224e773c..e27cc486ec 100755 --- a/lib/crypto/doc/src/crypto.xml +++ b/lib/crypto/doc/src/crypto.xml @@ -98,6 +98,14 @@ Mpint() = >]]> of atoms.

+ + algorithms() -> [atom()] + Provide a list of available crypto algorithms. + +

Provides the available crypto algorithms in terms of a list + of atoms.

+
+
info_lib() -> [{Name,VerNum,VerStr}] Provides information about the libraries used by crypto. -- cgit v1.2.3 From 45bbae42ef31a478487c8be19ddb44f34823fe57 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Wed, 27 Mar 2013 10:29:57 +0100 Subject: crypto: New SRP API Adjust API to better fit in with similar funtions in crypto --- lib/crypto/doc/src/crypto.xml | 138 ++++++++++++++++++++++-------------------- 1 file changed, 72 insertions(+), 66 deletions(-) (limited to 'lib/crypto/doc/src/crypto.xml') diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml index e27cc486ec..f30a058ca4 100755 --- a/lib/crypto/doc/src/crypto.xml +++ b/lib/crypto/doc/src/crypto.xml @@ -63,6 +63,11 @@

dss: Digital Signature Standard (FIPS 186-2)

+ +

srp: Secure Remote Password Protocol (RFC 2945)

+
+ +

The above publications can be found at NIST publications, at IETF.

@@ -1275,82 +1280,83 @@ Mpint() = >]]>
- srp_value_B(Multiplier, Verifier, Generator, Exponent, Prime) -> ValueB - Computes the SRP function: B = k*v + g^b % N - - Verifier (v), Generator (g), Exponent (b), Prime (N), ValueB (B) = binary() - Multiplier (k) = integer() | binary() - - -

Computes the SRP value B according to RFC-2945, Sect. 3 and RFC-5054, Sect. 2.5.3

-

B = k*v + g^b % N

-
-
- - - srp_client_secret(A, U, B, Multiplier, Generator, Exponent, Prime) -> Secret - Computes the SRP client secret - - A (a), U (u), B, Multiplier (k), Generator (g), Exponent (x), Prime (N), Secret = binary() - Multiplier (k) = integer() | binary() - - -

Computes the SRP client secret according to RFC-2945, Sect. 3 and RFC-5054, Sect. 2.6

-

Secret = (B - (k * g^x)) ^ (a + (u * x)) % N

-
-
- - - srp_server_secret(Verifier, B, U, A, Prime) -> Secret - Computes the SRP host secret - - Verifier (v), B (b), U (u), A, Prime (N), Secret = binary() - - -

Computes the SRP host secret according to RFC-2945, Sect. 3 and RFC-5054, Sect. 2.6

-

Secret = (A * v^u) ^ b % N

-
-
- - - srp3_value_u(B) -> Result - Computes the SRP3-SHA value u - - B = binary() - Result = integer() - - -

Computes the SRP-3 value u according to RFC-2945, Sect. 3 -

-
-
- - - srp6_value_u(A, B, Prime) -> Result - Computes the SRP6a value u as u = SHA1(PAD(A) | PAD(B)) + srp_generate_key(Generator, Prime, Version) -> {PublicKey, PrivateKey} + srp_generate_key(Generator, Prime, Version, Private) -> {PublicKey, PrivateKey} + srp_generate_key(Verifier, Generator, Prime, Version) -> {PublicKey, PrivateKey} + srp_generate_key(Verifier, Generator, Prime, Version, Private) -> {PublicKey, PrivateKey} + Generates SRP public keys - A, B, Prime = binary() - Result = integer() + Verifier = binary() + Parameter v from SRP design + + Generator = binary() + Parameter g from SRP design + + Prime = binary() + Parameter N from SRP design + + Version = '3' | '6' | '6a' + SRP version, TLS SRP cipher suites uses '6a'. + PublicKey = binary() + Parameter A or B from SRP design + PrivateKey = binary() - generated if not supplied + Parameter a or b from SRP design -

Computes the SRP-6 value u according to RFC-5054, Sect. 2.6 -

+

Generates SRP public keys

- srp6a_multiplier(Generator, Prime) -> Result - Computes the SRP-SHA function: k = SHA1(N | PAD(g)) - - Generator, Prime = binary() - Result = integer() - - -

Computes the SRP-6a function SHA1(N | PAD(g)) as the multiplier + srp_compute_key(DerivedKey, Prime, Generator, + ClientPublic, ClientPrivate, ServerPublic, Version) -> SessionKey + srp_compute_key(DerivedKey, Prime, Generator, + ClientPublic, ClientPrivate, ServerPublic, Version, Scrambler) -> SessionKey + srp_compute_key(Verifier, Prime, + ClientPublic, ServerPublic, ServerPrivate, Version, Scrambler)-> SessionKey + srp_compute_key(Verifier, Prime, + ClientPublic, ServerPublic, ServerPrivate, Version) -> SessionKey + + Computes SRP session key + + DerivedKey = binary() + Parameter x from SRP design + + Verifier = binary() + Parameter v from SRP design + + Prime = binary() + Parameter N from SRP design + + Generator = binary() + Parameter g from SRP design + + ClientPublic = binary() + Parameter A from SRP design + + ClientPrivate = binary() + Parameter a from SRP design + + ServerPublic = binary() + Parameter B from SRP design + + ServerPrivate = binary() + Parameter b from SRP design + + Version = '3' | '6' | '6a' + SRP version, TLS SRP cipher suites uses '6a'. + SessionKey = binary() + Result K from SRP design + + + +

+ Computes the SRP session key (shared secret). Also used + as premaster secret by TLS-SRP ciher suites.

- + exor(Data1, Data2) -> Result XOR data -- cgit v1.2.3