]>
Using Algebraic Eraser in OpenPGPSecureRF Corporation100 Beard Sawmill Rd, Suite 350SheltonCT06484US+1 617 623 3745datkins@securerf.com, derek@ihtfp.com
Security
Internet Engineering Task Forceopenpgpalgebraiceraseralgebraic eraserSecureRFAEAEKAPThe 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 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 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." This document specifies how to encode, store, and use the Algebraic Eraser(TM) Key Agreement Protocol (AEKAP) 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).AEKAP 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 AEKAP 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. Then 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 and conjugate sets and must be available to generate keys that can communicate. These Keysets MAY be published and named, but MUST be numbered with an OID.For two users to execute the AEKAP 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 AEKAP 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 nxn matrix where each entry in the matrix is a member of the field Fq. The key search space for the 1st private key is 2^nr (where q=2^r).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 (2k)^l (where k is the number of published conjugates, and l 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. Each Artin generator in the 2nd private key is associated to a specific Colored Burau (CB) matrix and permutation (see ). The E-multiplication occurs after you substitute the T-values in the CB Matrix with the values in the existing permutation. The result (the public key) is an nxn 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.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 AlgorithmTBD1AEKAP 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 AEKAP: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 AEKAP: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 and Dorian Goldfeld for their tireless efforts to review this document, suggest improvements, and explain to me how to improve my description of how AE works.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 .IDAlgorithmReferenceTBD1AEKAP 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.]The security considerations of apply accordingly.AEKAP 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.AEKAP is an encryption-only algorithm, therefore it cannot self-certify a key. To have an AEKAP 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 braidsTo help implementing this specification a non-normative example is provided. This example assumes:the algorithm id for AEKAP will be 22the 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.
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-08 15:24:20 from the tag conjugates (type 1), and thus the fingerprint of the OpenPGP key is:
176D 1360 FBB7 036C C281 8696 8741 94EC A3DF FA7Eand 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