RFC 4010
Use of the SEED Encryption Algorithm in Cryptographic Message Syntax (CMS)
Title Block πβ¨
Okay bestie, so this is RFC 4010, published February 2005 as a Standards Track doc π. It's by J. Park, S. Lee, J. Kim, and J. Lee, all from KISA (Korea Information Security Agency) π°π·. The title is "Use of the SEED Encryption Algorithm in Cryptographic Message Syntax (CMS)" π. The title block doesn't list anything it obsoletes or updates, so this one stands on its own πΈ.
Status of This Memo π
This doc is an Internet standards track protocol spec for the Internet community, and it's asking for discussion and suggestions for improvements π«Ά. If you want the current standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1) π. Distribution of this memo is unlimited π¦.
Copyright Notice π
Copyright (C) The Internet Society (2005). π
Abstract π§
This doc is all about the rules for using the SEED encryption algorithm for encryption with the Cryptographic Message Syntax (CMS) π.
SEED gets added to CMS's set of optional symmetric encryption algorithms π. It does that by getting two classes of unique object identifiers (OIDs) β¨. One OID class covers content encryption algorithms, and the other covers key encryption algorithms π .
1. Introduction β¨
Okay so this doc lays out how to use the SEED encryption algorithm [SEED][TTASSEED] for encryption with CMS [CMS] π. It gives you the relevant object identifiers (OIDs) and processing steps so SEED can be used in CMS for content and key encryption, as described in RFC 3852 and RFC 3370 πΈ.
1.1. SEED π·
SEED is a symmetric encryption algorithm that KISA (Korea Information Security Agency) and a group of experts have been developing since 1998 π. Its input/output block size and key length are both 128 bits π . It has a 16-round Feistel structure. A 128-bit input is split into two 64-bit blocks, and the right 64-bit block goes into the round function along with a 64-bit subkey from the key scheduling π§ .
SEED is easy to implement in lots of software and hardware, because it uses less memory than other algorithms and generates keys without hurting the algorithm's security π«Ά. It works especially well in computing environments with restricted resources, like mobile devices and smart cards π±.
SEED holds up against known attacks, including DC (Differential cryptanalysis), LC (Linear cryptanalysis), and related key attacks π₯. It's been through wide public scrutiny π. Credible organizations, ISO/IEC JTC 1/SC 27 and Japan CRYPTREC (Cryptography Research and Evaluation Committees), have evaluated it and consider it cryptographically secure [ISOSEED][CRYPTREC] π.
SEED is a national industrial association standard [TTASSEED], and it's widely used in South Korea for electronic commerce and financial services on wired and wireless communications π°π·π.
1.2. Terminology π
The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this doc (in uppercase, as shown) get interpreted as described in [RFC2119] π¦. These are the requirement words, so pay attention to them π.
2. Object Identifiers for Content and Key Encryption π
This section has the OIDs and processing info needed for SEED to be used for content and key encryption in CMS π. SEED gets added to CMS's set of optional symmetric encryption algorithms by way of two classes of unique object identifiers (OIDs) β¨. One class covers content encryption and the other covers key encryption π. So a CMS agent can apply SEED for either one by picking the matching object identifier, supplying the required parameter, and starting the program code π§.
2.1. OIDs for Content Encryption π
SEED is added to the set of symmetric content encryption algorithms defined in [CMSALG] πΈ. The SEED content-encryption algorithm in Cipher Block Chaining (CBC) mode has this object identifier:
id-seedCBC OBJECT IDENTIFIER ::=
{ iso(1) member-body(2) korea(410) kisa(200004)
algorithm(1) seedCBC(4) }
The AlgorithmIdentifier parameters field MUST be present, and the parameters field MUST contain the value of Initialization Vector (IV) π¨:
SeedCBCParameter ::= SeedIV -- Initialization Vector
SeedIV ::= OCTET STRING (SIZE(16))
The plain text gets padded according to Section 6.3 of [CMS] π«§.
2.2. OIDs for Key Encryption ποΈ
The key-wrap/unwrap procedures for encrypting/decrypting a SEED content-encryption key (CEK) with a SEED key-encryption key (KEK) are specified in Section 3 π. Generation and distribution of key-encryption keys are beyond the scope of this document π ββοΈ.
The SEED key-encryption algorithm has this object identifier:
id-npki-app-cmsSeed-wrap OBJECT IDENTIFIER ::=
{ iso(1) member-body(2) korea(410) kisa(200004) npki-app(7)
smime(1) alg(1) cmsSEED-wrap(1) }
The parameter tied to this object identifier MUST be absent π ββοΈ, because the key wrapping procedure itself decides how and when to use an IV π§.
3. Key Wrap Algorithm π
3.1. Notation and Definitions π
These are the notation and definitions used in the key wrapping algorithms π·:
SEED(K, W) Encrypt W using the SEED codebook with key K
SEED-1(K, W) Decrypt W using the SEED codebook with key K
MSB(j, W) Return the most significant j bits of W
LSB(j, W) Return the least significant j bits of W
B1 ^ B2 The bitwise exclusive or (XOR) of B1 and B2
B1 | B2 Concatenate B1 and B2
K The key-encryption key K
n The number of 64-bit key data blocks
s The number of steps in the wrapping process,
s = 6n
P[i] The ith plaintext key data block
C[i] The ith ciphertext data block
A The 64-bit integrity check register
R[i] An array of 64-bit registers where
i = 0, 1, 2, ..., n
A[t], R[i][t] The contents of registers A and R[i] after
encryption step t.
IV The 64-bit initial value used during the
wrapping process.
In the key wrap algorithm, the concatenation function gets used to glue 64-bit quantities together into the 128-bit input for the SEED codebook π§©. The extraction functions split the 128-bit output from the SEED codebook into two 64-bit quantities βοΈ.
3.2. SEED Key Wrap π
Key wrapping with SEED is identical to Section 2.2.1 of [RFC3394], with "AES" swapped out for "SEED" π.
The inputs to the key wrapping process are the KEK and the plaintext to be wrapped π. The plaintext is n 64-bit blocks holding the key data being wrapped. Here's how the wrapping process goes π:
Inputs: Plaintext, n 64-bit values {P[1], P[2], ..., P[n]}, and
Key, K (the KEK).
Outputs: Ciphertext, (n+1) 64-bit values {C[0], C[1], ..., C[n]}.
1) Initialize variables.
Set A[0] to an initial value (see Section 3.4)
For i = 1 to n
R[0][i] = P[i]
2) Calculate intermediate values.
For t = 1 to s, where s = 6n
A[t] = MSB(64, SEED(K, A[t-1] | R[t-1][1])) ^ t
For i = 1 to n-1
R[t][i] = R[t-1][i+1]
R[t][n] = LSB(64, SEED(K, A[t-1] | R[t-1][1]))
3) Output the results.
Set C[0] = A[s]
For i = 1 to n
C[i] = R[s][i]
There's also an alternative way to describe the key wrap algorithm, using indexing instead of shifting π§ . This lets you calculate the wrapped key in place, skipping the rotation from the previous description. It gives identical results and is easier to implement in software π».
Inputs: Plaintext, n 64-bit values {P[1], P[2], ..., P[n]}, and
Key, K (the KEK).
Outputs: Ciphertext, (n+1) 64-bit values {C[0], C[1], ..., C[n]}.
1) Initialize variables.
Set A = IV, an initial value (see Section 3.4)
For i = 1 to n
R[i] = P[i]
2) Calculate intermediate values.
For j = 0 to 5
For i=1 to n
B = SEED(K, A | R[i])
A = MSB(64, B) ^ t where t = (n*j)+i
R[i] = LSB(64, B)
3) Output the results.
Set C[0] = A
For i = 1 to n
C[i] = R[i]
3.3. SEED Key Unwrap π
Key unwrapping with SEED is identical to Section 2.2.2 of [RFC3394], with "AES" replaced by "SEED" π.
The inputs to the unwrap process are the KEK and (n+1) 64-bit blocks of ciphertext, which hold the previously wrapped key π. It returns n blocks of plaintext, which are the n 64-bit blocks of the decrypted key data πΈ.
Inputs: Ciphertext, (n+1) 64-bit values {C[0], C[1], ..., C[n]},
and Key, K (the KEK).
Outputs: Plaintext, n 64-bit values {P[1], P[2], ..., P[n]}.
1) Initialize variables.
Set A[s] = C[0] where s = 6n
For i = 1 to n
R[s][i] = C[i]
2) Calculate the intermediate values.
For t = s to 1
A[t-1] = MSB(64, SEED-1(K, ((A[t] ^ t) | R[t][n]))
R[t-1][1] = LSB(64, SEED-1(K, ((A[t]^t) | R[t][n]))
For i = 2 to n
R[t-1][i] = R[t][i-1]
3) Output the results.
If A[0] is an appropriate initial value (see Section 3.4),
Then
For i = 1 to n
P[i] = R[0][i]
Else
Return an error
The unwrap algorithm can also be written as an index-based operation, so the calculations can be done in place π§©. Again, this gives the same results as the register shifting approach β¨.
Inputs: Ciphertext, (n+1) 64-bit values {C[0], C[1], ..., C[n]},
and Key, K (the KEK).
Outputs: Plaintext, n 64-bit values {P[0], P[1], ..., P[n]}.
1) Initialize variables.
Set A = C[0]
For i = 1 to n
R[i] = C[i]
2) Compute intermediate values.
For j = 5 to 0
For i = n to 1
B = SEED-1(K, (A ^ t) | R[i]) where t = n*j+i
A = MSB(64, B)
R[i] = LSB(64, B)
3) Output results.
If A is an appropriate initial value (see Section 3.4),
Then
For i = 1 to n
P[i] = R[i]
Else
Return an error
3.4. Key Data Integrity -- the Initial Value π
The initial value (IV) is the value assigned to A[0] in the first step of the wrapping process π·. This value gets used to check the integrity of the key data π‘οΈ. In the final step of the unwrapping process, the recovered value of A[0] gets compared to the expected value of A[0] π. If they match, the key is accepted as valid and the unwrapping algorithm returns it π. If they don't match, the key is rejected and the unwrapping algorithm returns an error π.
The exact properties this integrity check gives you depend on how the initial value is defined π§ . Different applications might need somewhat different properties, like whether they need to check the integrity of key data across its whole lifecycle or only when it's unwrapped β³. This spec defines a default initial value that protects key data while it's wrapped (in Section 3.4.1) π. It also makes room for alternative initial values (in Section 3.4.2) π.
3.4.1. Default Initial Value β¨
Okay so the default initial value (IV) is one specific hex constant, and it's giving very deliberate π
A[0] = IV = A6A6A6A6A6A6A6A6
Using a constant as the IV is what gives you a strong integrity check on the key data while it's wrapped π. If unwinding produces A[0] = A6A6A6A6A6A6A6A6, the chance that the key data is corrupt is 2^-64, which is basically never π. If unwrapping produces A[0] = any other value, the unwrap MUST return an error and not return any key data. No key data, no exceptions, periodt π
3.4.2. Alternative Initial Values π¦
Sometimes the key wrap is part of a bigger key management protocol or system. In that case the integrity scope might need to cover more than just the key data, and the duration might need to be longer than just the time it's wrapped β³. Also, if the key data isn't only a SEED key, it might not be a multiple of 64 bits π¬. Alternative initial values can fix those problems. According to RFC 3394 [RFC3394], NIST will define alternative initial values in future key management publications as they're needed. Since a set of alternatives might evolve over time, non-application-specific key wrap implementations will require some flexibility in how the initial value is set and tested. Flexibility is everything π
4. SMIMECapabilities Attribute π
An S/MIME client SHOULD announce the set of cryptographic functions it supports by using the S/MIME capabilities attribute π£. This attribute gives a partial list of OIDs for cryptographic functions, and it MUST be signed by the client. The functions' OIDs SHOULD be logically separated into functional categories, and they MUST be ordered by preference π§.
RFC 3851 [RFC3851], Section 2.5.2 defines the SMIMECapabilities signed attribute (a SEQUENCE of SMIMECapability SEQUENCEs) that's used to specify a partial list of algorithms the software announcing the SMIMECapabilities can support. Main character energy, the attribute is the list of what you can do π
If an S/MIME client is required to support symmetric encryption with SEED, the capabilities attribute MUST contain the SEED OID specified above in the category of symmetric algorithms. The parameter associated with this OID MUST be SeedSMimeCapability:
SeedSMimeCapabilty ::= NULL
The SMIMECapability SEQUENCE representing SEED MUST be DER-encoded as the following hexadecimal strings:
30 0C 06 08 2A 83 1A 8C 9A 44 01 04 05 00
When a sending agent creates an encrypted message, it has to decide which encryption algorithm to use π€. Usually that decision is based on the capabilities lists in messages it received from the recipient, plus other stuff like private agreements, user preferences, and legal restrictions. If local policy requires SEED for symmetric encryption, then both the sending and receiving S/MIME clients must support it, and SEED must be configured as the preferred symmetric algorithm π«Ά.
5. Security Considerations π
β οΈ This is the serious part, bestie, so read it carefully. Nothing here is optional vibes.
This document specifies the use of SEED for encrypting the content of a CMS message, and also for encrypting the symmetric key used to encrypt that content. Everything else works the same as the existing mechanisms. Therefore, the security considerations described in the CMS specifications [CMS][CMSALG] and the AES key wrap algorithm [RFC3394] can be applied to this document. No security problem has been found on SEED [CRYPTREC] β .
6. References π
6.1. Normative References
[TTASSEED] Telecommunications Technology Association (TTA), South Korea, "128-bit Symmetric Block Cipher (SEED)", TTAS.KO-12.0004, September, 1998 (In Korean) http://www.tta.or.kr/English/new/main/index.htm
[CMS] Housley, R., "Cryptographic Message Syntax (CMS)", RFC 3852, July 2004.
[CMSALG] Housley, R., "Cryptographic Message Syntax (CMS) Algorithms", RFC 3370, August 2002.
[RFC3851] Ramsdell, B., "Secure/Multipurpose Internet Mail Extensions (S/MIME) Version 3.1 Message Specification", RFC 3851, July 2004.
[RFC3394] Schaad, J. and R. Housley, "Advanced Encryption Standard (AES) Key Wrap Algorithm", RFC 3394, September 2002.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
6.2. Informative References
[SEED] Park, J., Lee, S., Kim, J., and J. Lee, "The SEED Encryption Algorithm", RFC 4009, February 2005.
[ISOSEED] ISO/IEC, ISO/IEC JTC1/SC 27 N 256r1, "National Body contributions on NP 18033 Encryption algorithms in response to document SC 27 N 2563", October, 2000
[CRYPTREC] Information-technology Promotion Agency (IPA), Japan, CRYPTREC. "SEED Evaluation Report", February, 2002 http://www.kisa.or.kr
Appendix A. ASN.1 Module π§©
SeedEncryptionAlgorithmInCMS
{ iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1)
pkcs9(9) smime(16) modules(0) id-mod-cms-seed(24) }
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
id-seedCBC OBJECT IDENTIFIER ::=
{ iso(1) member-body(2) korea(410) kisa(200004)
algorithm(1) seedCBC(4) }
-- Initialization Vector (IV)
SeedCBCParameter ::= SeedIV
SeedIV ::= OCTET STRING (SIZE(16))
-- SEED Key Wrap Algorithm identifiers - Parameter is absent.
id-npki-app-cmsSeed-wrap OBJECT IDENTIFIER ::=
{ iso(1) member-body(2) korea(410) kisa(200004) npki-app(7)
smime(1) alg(1) cmsSEED-wrap(1) }
-- SEED S/MIME Capability parameter
SeedSMimeCapability ::= NULL
END
Authors' Addresses πΈ
Jongwook Park Korea Information Security Agency 78, Garak-Dong, Songpa-Gu, Seoul, 138-803 REPUBLIC OF KOREA
Phone: +82-2-405-5432 FAX : +82-2-405-5499 EMail: khopri@kisa.or.kr
Sungjae Lee Korea Information Security Agency
Phone: +82-2-405-5243 FAX : +82-2-405-5499 EMail: sjlee@kisa.or.kr
Jeeyeon Kim Korea Information Security Agency
Phone: +82-2-405-5238 FAX : +82-2-405-5499 EMail: jykim@kisa.or.kr
Jaeil Lee Korea Information Security Agency Phone: +82-2-405-5300 FAX : +82-2-405-5499 EMail: jilee@kisa.or.kr
Full Copyright Statement βοΈ
Copyright (C) The Internet Society (2005).
This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.
This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Intellectual Property π§Ύ
The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the IETF's procedures with respect to rights in IETF Documents can be found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.
Acknowledgement π
Funding for the RFC Editor function is currently provided by the Internet Society.
π¦ where this page comes from
- ietf: rfc4010 2005-02
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms