]>
Using Algebraic Eraser (AEDH) in OpenPGPSecureRF Corporation100 Beard Sawmill Rd, Suite 350SheltonCT06484US+1 617 623 3745datkins@securerf.com, derek@ihtfp.com
Security
Internet Engineering Task Forceopenpgpalgebraiceraseralgebraic eraserSecureRFAEAEKAPAEDHThe Algebraic Eraser(TM) is an encryption engine that supports, among other configurations, a Diffie-Hellman-like key agreement protocol. This draft specifies how to encode, store, share, and use Algebraic Eraser Key Agreement Protocol (AEKAP, also called AEDH) keys in OpenPGP.The OpenPGP specification in defines the use of RSA, Elgamal, and DSA public key algorithms. adds support for Elliptic Curve Cryptography and specifies the ECDSA and ECDH algorithms.The Algebraic Eraser(TM) was first introduced in Key agreement, the Algebraic Eraser, and lightweight cryptography published by the American Mathematical Society in 2004. It describes "a new key agreement protocol suitable for implementation on low-cost platforms which constrain the use of computational resources." It is further compared to other algorithims in . This document specifies how to encode, store, and use the Algebraic Eraser Key Agreement Protocol (AEKAP, also called AEDH) in OpenPGP.The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.The Algebraic Eraser brings together the Braid Group, Matrices, and operations over small Finite Fields to produce an algorithm that executes linear in time with the increase in key size.A complete description of the Algebraic Eraser is available in .The Algebraic Eraser defines an operation called "E-Multiplication" upon which the algorithm is based (see ). E-Multiplication (denoted herein by *) takes one matrix (M0) and permutation (S0) and operates on a second matrix (M1) and permutation (S1), resulting in another matrix (M2) and permutation (S2). In other words: (M0,S0) * (M1,S1) = (M2,S2).The secret to E-multiplication is that you can take a Braid element (an "Artin generator") and map that to a matrix and permutation upon which you can operate. Specifically, each Artin generator is associated to a specific Colored Burau (CB) matrix and permutation (see ). The E-multiplication process involves permuting the variables in the CB matrix using the current permutation, substituting those variables with the TValues from the Keyset (see ), then multiplying that against the starting matrix resulting in the another matrix. Then you multiply the permutations, resulting in a new permutation. This new matrix and permutation is the the result of the E-Multiplication.AEDH Keyset Parameters are similar to Diffie-Hellman cyclic groups of prime order or ECC curves. Just as users must choose the same DH prime or ECC curve in order to communicate, similarly participants in the AEDH must be using the same Keyset Parameters.The first basic set of parameters is the chosen Braid Group and Field Size, BnFq, where n is the number of strands in the chosen braid (also called the braid index) and q is the size of the field in use. The field size, q, must be a power of a prime. Generally it is 2^r (where r is a small integer) although this is not a requirement. For example, one might choose B10F8 or B16F32. This is like choosing how many bits to use when generating a prime for Diffie-Hellman.Once the BnFq space is chosen then the Keyset Parameters can be generated by a trusted third party (TTP). First they generate an n-by-n matrix (M) where each entry in the matrix is a member of the field Fq. Second, the TTP generates a set of TValues, which is an array of n invertable entries within the field Fq (i.e., values 1 to Fq-1). Finally, the TTP generates at least two sets of braid conjugates, Ca and Cb, where each conjugate in Ca commutes with each conjugate in Cb. The conjugates are lists of "braid words", or "Artin generators" within the Bn braid group. The TTP generates La conjugates for set Ca and Lb conjugates for set Cb, where the numbers La and Lb MAY be different.The public Keyset Parameters are the Matrix (M), TValues array, and conjugate sets and must be available to generate keys that can communicate. Moreover, the TValue array must be available to anyone using the Keyset. These Keysets MAY be published and named, but MUST be numbered with an OID.For two users to execute the AEDH they MUST generate keys from the same Keyset and they MUST choose from different conjugate sets within that Keyset. I.e., for Alice and Bob to complete the AEDH Alice must generate her key from Ca and Bob must generate his key from Cb.This document does not specify any particular Keyset Parameters that MUST be implemented.The Algebraic Eraser has a two-part Private Key and a two-part Public Key. The Public key is then generated from the two Private Keys.To generate the 1st private key you generate a random polynomial and apply that to the public matrix from the keyset within the keyset field. This results in an n-by-n matrix where each entry in the matrix is a member of the field Fq (although the last row of the matrix contains n-1 zeros). The key search space for the 1st private key is q^(n-1). Note that the 1st private key permutation is always the identity permutation, so there is no need to store it.To generate the 2nd private key you choose a random set of conjugates (and inverses) and string them together. This results in a long string of Artin generators (and inverses). You MAY reduce the string if you so choose using the Dehornoy reduction . The search space of the 2nd private key is (2l)^k (where l is the number of published conjugates (La or Lb), and k the number of chosen conjugates and inverses).The Public Key is computed by an E-Multiplication of the 1st private key and the 2nd private key, where the 2nd private key is iteratively processed (see . The result (the public key) is an n-by-n matrix of Fq and another permutation.Note that the last row of the Public Key Matrix is all zero except for the last entry. When encoding the Public Key you SHOULD ignore those zeros.To compute the shared secret you first perform regular matrix multiplication of the 1st private key against the matrix component of the public key you receive from the other person. This results in another matrix. The permutation of the 1st private key is the identity, hence the result of multiplying it against the permutation of the public key leaves the permutation of the public key unchanged and you can just use it directly. Then you perform E-multiplication of this matrix/permutation result against the 2nd private key. The resulting matrix/permutation is the shared secret.Each portion of a key can be reduced to a byte-string (or, more accurately, multiple byte strings). Each matrix can be encoded by stringing together each field element in each row and then stringing each row together. A permutation can be encoded by stringing together each element in the list. The conjugates are also encoded by stringing together each element.The following public key algorithm IDs are added to expand section 9.1 of , "Public-Key Algorithms":IDDescription of AlgorithmTBD1AEDH public key algorithmEncoding of Public and Private keys MUST use the version 4 packet format (or newer).The Algebraic eraser uses matrices, fields, and braids that are denoted in bits, particular strings of bits. These objects need to be encoded into bit strings for storage and transmission. The most simplistic method of encoding is to take each field as a byte (or multi-byte word) and string them together. The following sections detail multiple (alternate) ways these bit strings can be encoded to possibly reduce the space used.Depending on the number of bits used per element (which is defined by the braid index and field size), using different encodings of these strings may result in reducing storage space by dropping extra bits and combining elements.For example, when using the finite field F16 each entry can be encoded in exactly one nibble of four (4) bits, so you can easily combine two entries into a single 8-bit byte (called nibble-encoding). This technique could also be used for entries smaller than a nibble, although then you would still have extra (unused) bits. When using the nibble-encoding of an odd number of nibbles the encoding rules MUST specify whether the extra nibble is at the leading or trailing byte.Another encoding option is bit-stealing. This merges all bits together and then cuts it up into 8-bit bytes. For example if the entries are 5 bits each you might steal 3 bits from the second entry to merge into the first, then shift the remaining 2 bits of the second entry, combine with the next 5 bits from the third, and then steal one bit from the fourth entry, and so on, until you've reached the end. This could end up with unused bits at the end of the string.Yet another option is the reverse-bit-stealing, where you start at the end of the string and work your way to the front. This could leave you with unused bits a the front of the string.Assume you require five (5) bits to encode your numbers, the following table shows how you could could use bit stealing and reverse bit stealing to encode them (where a, b, c, and d are the bits in the first, second, third, and fourth entries)Full Bytes:000aaaaa000bbbbb000ccccc000dddddBit stealing:aaaaabbbbbcccccddddd0000Reverse bit stealing:0000aaaaabbbbbcccccdddddAny unused bits MUST be left as zero (and MUST be checked to be zero).The actual encoding method MUST be defined by the Keyset parameter definition and may change from one keyset parameter to another.The row of zeros in the matrix SHOULD be assumed to "not exist". When using these encoding techniques you SHOULD just tack the last entry of the final row onto the end of the list of entries of the rest of the matrix. This could result in an odd number of entries depending on your n and q choices potentially requiring passing at the start or end of the bit string.In the case of entries wider than 8 bits (e.g. a Field parameter greater than 256), the bits are combined in network byte order. However they can still be merged together using the same encoding algorithms from in the case of entries that are not 8-bit multiples. For example, a 12-bit field (F4096) could be combined a nibble at a time, or a 10-bit field (F1024) could use bit-stealing.The following algorithm specific packets are added to Section 5.5.2 of , "Public-Key Packet Formats", to support AEDH:a variable length field containing a keyset parameter OID, formatted as follows (see for a full description of the OID encoding method):
a one-octet size of the following field; values 0 and 0xFF are reserved for future extensions,octets representing a keyset parameter OIDone byte denoting from which set of conjugates in the keyset this key was generated (e.g. the Alice set or the Bob set)MPI of the public key matrixMPI of the public key permutationThe following algorithm specific packets are added to Section 5.5.3 of , "Secret-Key Packet Formats", to support AEDH:MPI of the 1st private key (matrix)MPI of the 2nd private key (conjugate string)The term "Algebraic Eraser" is a trademark of SecureRF Corporation and is used herein with permission.The author would like to thank Paul Gunnells, Dorian Goldfeld, and Iris Anshel for their tireless efforts to review this document, suggest improvements, and explain to me how to improve my description of how AE works. Big thanks also to Werner Koch and Vedaal for their comments and suggestions.IANA is requested to assign an algorithm number from the OpenPGP Public-Key Algorithms range, or the "namespace" in the terminology of , that was created by . See .IDAlgorithmReferenceTBD1AEDH public key algorithmThis doc[Notes to RFC-Editor: Please remove the table above on publication. It is desirable not to reuse old or reserved algorithms because some existing tools might print a wrong description. A higher number is also an indication for a newer algorithm. As of now 22 is the next free number, but we request the selection of 23.]The security considerations of apply accordingly.AEDH will generate the same session key when used with the same two public/private key pairs. The authors of AE generally recommend that at least one party use an ephemeral key pair in order to prevent the same session key being generated every time.AEDH is an encryption-only algorithm, therefore it cannot self-certify a key. To have an AEDH master key you MUST implement .When using the generated session key, you MUST only use the bits included in the protocol. You should MUST NOT use any always-zero bits, including those in the last row of the matrix.Key agreement, the Algebraic Eraser, and lightweight cryptography
&RFC2119;
&RFC4880;
&RFC5226;
&RFC6637;
&I-D.atkins-openpgp-device-certificates;
A fast method for comparing braidsAn Introduction to Cryptographic Security Methods and Their Role in Securing Low Resource Computing DevicesTo help implementing this specification a non-normative example is provided. This example assumes:the algorithm id for AEDH will be 23the keyset OID 1.3.6.1.4.1.44196.1.0.0, which defines:
the braid/field as B10F8the public key packing is nibble-packed with trailing zerosthe 2nd private key is not bit-packed; it uses bit 7 to define "inverse" and bits 3-0 to define the Artin generator.the TValues are: 6 5 4 4 3 2 6 6 3 4
and gets encoded with length 11 and the following hex bytes: 2B 06 01 04 01 82 D9 24 01 00 00The secret key used for this example is:1st Private Key Matrix:2nd Private key (in hex):
06048182030405038484050602830405068283848581020304850687880788098485838482838485838383848506870807080986878888888788058607880908098788078809080987880903048585038484858383848384850607080987880906050607080987878886078809068708098304050607080903040506070809020384050607040506070883848485858384838485858687068708010203040506070809858687888885858683848585818282828282818182820304858687880908090708060708098485858686028304058686860182030485858687878787080809810203848586010203040586070887878787878708818182838485868708060707060606070607080909060788098809068788090708878708098687880909060708098788868787888807880607880986878888888687878888878788880788098788060788090906870807080909868687880707880909098788868687880988098809090687880788090687888807880606068788098708080808070809868788090988878809098788060706060707078809080987880906070809878788868686878787880988090909060708090687880988888809098788090907880987880788090909878809070809868788060788090809878888888888090987888607888809060708098687888686878788880909080987888809060708098788880687880987080986878809060708098787880988090708098706870809070809868687878888868686868686078888098788098787068788878886078806878807888607880687888807880986878787878807880607888607070707078809870808098686860708878787088687088687870809070708868787878787878708080607088686870809090607080986878807880909080987080987080987080986878806078809090687880909070788098687888888878809080708090786078809098708080809090808080808098788070786070788090909878809098687888888090986878809098182838485868788090607050605060607860707070704830485860707078203848586078102838485060607070708080909840182838405060788090904050687088182838485868708870808010203048506070102038405060708080202010102020202028384858687018283848586870803848586070607080988880909878809868788048586078809090506070809070886870809818283848586878807880987880788098788078809040304030304040506870808098586878809060708080607058304030303030405860203040584058683048582038485010203040485860582838483840201The key was created on 2014-09-09 16:35:36 from the tag conjugates (type 1), and thus the fingerprint of the OpenPGP key is:
8020 A772 BA18 EA47 3501 B8CE EABE 1082 56BB 5D64and the entire public key packet is:
The key agreement is created using the sample key against a second (reader) public key. The reader public key has the following data:Matrix (in nibbled-packed hex with trailing zeros):
Permutation (in nibble-packed hex): 32 14 56 78 9aWhich results in the following shared secret:Matrix:
Permutation (decimal): 3 2 1 5 7 6 10 8 9 4