Tweet This is a modified version of the Internet RFC suitable for machine-translating. Original version is available here: RFC6229
Ad
INFORMATIONAL
Internet Engineering Task Force (IETF) J. Strombergson
Request for Comments: 6229 SecWorks Sweden AB
Category: Informational S. Josefsson
ISSN: 2070-1721 Simon Josefsson Datakonsult AB
May 2011
Test Vectors for the Stream Cipher RC4
Abstract
This document contains test vectors for the stream cipher RC4.
Status of This Memo
This document is not an Internet Standards Track specification; it is published for informational purposes.
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Not all documents approved by the IESG are a candidate for any level of Internet Standard; see Section 2 of RFC 5741.
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc6229.
Copyright Notice
Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
Strombergson & Josefsson Informational [Page 1]
RFC 6229 Test Vectors for the Stream Cipher RC4 May 2011
The RC4 [RC4] algorithm is a widely used stream cipher. Test vectors for algorithms are useful for implementers. The RC4 cipher can use different key lengths. Advances in crypto-analysis [FMcG][MANTIN01][MIRONOV][MANTIN05] suggest that initial parts of the stream output need to be discarded. This document contains several test vectors for different key lengths and for different offsets in the stream.
Motivation for this document arose from the implementation of [RFC4345].
The test vectors provided in this document have been collected by generating RC4 keystream output from three separate implementations and comparing the streams. The RC4 implementations used are Libgcrypt 1.4.4 [LIBGCRYPT], Nettle 2.0 [NETTLE], and a custom implementation.
The document contains test vectors for two different keys:
Key 1: The key byte index (starting on one), that is: 0x01, 0x02,
0x03, 0x04,...
Key 2: Generated by hashing the string "Internet Engineering Task
Force" with the SHA-256 [SHS][RFC4634] hash function, using the following command:
The generated string has also been verified using the SHA-256 hash function implementation in OpenSSL (versions 0.9.8l and 1.0.0a) [OPENSSL].
The digest that is generated is then truncated to the appropriate length, keeping the Least Significant Bit (LSB) part of the digest as the key. The key lengths used in this document are 40, 56, 64, 80, 128, 192, and 256 bits, respectively. The stream offsets used in this document are 0, 256, 512, 768, 1024, 1536, 2048, 3072, and 4096 bytes, respectively. Offset 1536 corresponds to recommendations in [RFC4345]. The offsets 768 and 3072 correspond to recommendations in [SANS].
Strombergson & Josefsson Informational [Page 2]
RFC 6229 Test Vectors for the Stream Cipher RC4 May 20112. Test Vectors for RC4
Key length: 40 bits. key: 0x0102030405
DEC 0 HEX 0: b2 39 63 05 f0 3d c0 27 cc c3 52 4a 0a 11 18 a8 DEC 16 HEX 10: 69 82 94 4f 18 fc 82 d5 89 c4 03 a4 7a 0d 09 19 DEC 240 HEX f0: 28 cb 11 32 c9 6c e2 86 42 1d ca ad b8 b6 9e ae DEC 256 HEX 100: 1c fc f6 2b 03 ed db 64 1d 77 df cf 7f 8d 8c 93 DEC 496 HEX 1f0: 42 b7 d0 cd d9 18 a8 a3 3d d5 17 81 c8 1f 40 41 DEC 512 HEX 200: 64 59 84 44 32 a7 da 92 3c fb 3e b4 98 06 61 f6 DEC 752 HEX 2f0: ec 10 32 7b de 2b ee fd 18 f9 27 76 80 45 7e 22 DEC 768 HEX 300: eb 62 63 8d 4f 0b a1 fe 9f ca 20 e0 5b f8 ff 2b DEC 1008 HEX 3f0: 45 12 90 48 e6 a0 ed 0b 56 b4 90 33 8f 07 8d a5 DEC 1024 HEX 400: 30 ab bc c7 c2 0b 01 60 9f 23 ee 2d 5f 6b b7 df DEC 1520 HEX 5f0: 32 94 f7 44 d8 f9 79 05 07 e7 0f 62 e5 bb ce ea DEC 1536 HEX 600: d8 72 9d b4 18 82 25 9b ee 4f 82 53 25 f5 a1 30 DEC 2032 HEX 7f0: 1e b1 4a 0c 13 b3 bf 47 fa 2a 0b a9 3a d4 5b 8b DEC 2048 HEX 800: cc 58 2f 8b a9 f2 65 e2 b1 be 91 12 e9 75 d2 d7 DEC 3056 HEX bf0: f2 e3 0f 9b d1 02 ec bf 75 aa ad e9 bc 35 c4 3c DEC 3072 HEX c00: ec 0e 11 c4 79 dc 32 9d c8 da 79 68 fe 96 56 81 DEC 4080 HEX ff0: 06 83 26 a2 11 84 16 d2 1f 9d 04 b2 cd 1c a0 50 DEC 4096 HEX 1000: ff 25 b5 89 95 99 67 07 e5 1f bd f0 8b 34 d8 75 Key length: 56 bits. key: 0x01020304050607
Strombergson & Josefsson Informational [Page 3]
RFC 6229 Test Vectors for the Stream Cipher RC4 May 2011
DEC 0 HEX 0: 29 3f 02 d4 7f 37 c9 b6 33 f2 af 52 85 fe b4 6b DEC 16 HEX 10: e6 20 f1 39 0d 19 bd 84 e2 e0 fd 75 20 31 af c1 DEC 240 HEX f0: 91 4f 02 53 1c 92 18 81 0d f6 0f 67 e3 38 15 4c DEC 256 HEX 100: d0 fd b5 83 07 3c e8 5a b8 39 17 74 0e c0 11 d5 DEC 496 HEX 1f0: 75 f8 14 11 e8 71 cf fa 70 b9 0c 74 c5 92 e4 54 DEC 512 HEX 200: 0b b8 72 02 93 8d ad 60 9e 87 a5 a1 b0 79 e5 e4 DEC 752 HEX 2f0: c2 91 12 46 b6 12 e7 e7 b9 03 df ed a1 da d8 66 DEC 768 HEX 300: 32 82 8f 91 50 2b 62 91 36 8d e8 08 1d e3 6f c2 DEC 1008 HEX 3f0: f3 b9 a7 e3 b2 97 bf 9a d8 04 51 2f 90 63 ef f1 DEC 1024 HEX 400: 8e cb 67 a9 ba 1f 55 a5 a0 67 e2 b0 26 a3 67 6f DEC 1520 HEX 5f0: d2 aa 90 2b d4 2d 0d 7c fd 34 0c d4 58 10 52 9f DEC 1536 HEX 600: 78 b2 72 c9 6e 42 ea b4 c6 0b d9 14 e3 9d 06 e3 DEC 2032 HEX 7f0: f4 33 2f d3 1a 07 93 96 ee 3c ee 3f 2a 4f f0 49 DEC 2048 HEX 800: 05 45 97 81 d4 1f da 7f 30 c1 be 7e 12 46 c6 23 DEC 3056 HEX bf0: ad fd 38 68 b8 e5 14 85 d5 e6 10 01 7e 3d d6 09 DEC 3072 HEX c00: ad 26 58 1c 0c 5b e4 5f 4c ea 01 db 2f 38 05 d5 DEC 4080 HEX ff0: f3 17 2c ef fc 3b 3d 99 7c 85 cc d5 af 1a 95 0c DEC 4096 HEX 1000: e7 4b 0b 97 31 22 7f d3 7c 0e c0 8a 47 dd d8 b8
Key length: 64 bits. key: 0x0102030405060708
DEC 0 HEX 0: 97 ab 8a 1b f0 af b9 61 32 f2 f6 72 58 da 15 a8 DEC 16 HEX 10: 82 63 ef db 45 c4 a1 86 84 ef 87 e6 b1 9e 5b 09 DEC 240 HEX f0: 96 36 eb c9 84 19 26 f4 f7 d1 f3 62 bd df 6e 18 DEC 256 HEX 100: d0 a9 90 ff 2c 05 fe f5 b9 03 73 c9 ff 4b 87 0a DEC 496 HEX 1f0: 73 23 9f 1d b7 f4 1d 80 b6 43 c0 c5 25 18 ec 63 DEC 512 HEX 200: 16 3b 31 99 23 a6 bd b4 52 7c 62 61 26 70 3c 0f DEC 752 HEX 2f0: 49 d6 c8 af 0f 97 14 4a 87 df 21 d9 14 72 f9 66 DEC 768 HEX 300: 44 17 3a 10 3b 66 16 c5 d5 ad 1c ee 40 c8 63 d0 DEC 1008 HEX 3f0: 27 3c 9c 4b 27 f3 22 e4 e7 16 ef 53 a4 7d e7 a4 DEC 1024 HEX 400: c6 d0 e7 b2 26 25 9f a9 02 34 90 b2 61 67 ad 1d DEC 1520 HEX 5f0: 1f e8 98 67 13 f0 7c 3d 9a e1 c1 63 ff 8c f9 d3 DEC 1536 HEX 600: 83 69 e1 a9 65 61 0b e8 87 fb d0 c7 91 62 aa fb DEC 2032 HEX 7f0: 0a 01 27 ab b4 44 84 b9 fb ef 5a bc ae 1b 57 9f DEC 2048 HEX 800: c2 cd ad c6 40 2e 8e e8 66 e1 f3 7b db 47 e4 2c DEC 3056 HEX bf0: 26 b5 1e a3 7d f8 e1 d6 f7 6f c3 b6 6a 74 29 b3 DEC 3072 HEX c00: bc 76 83 20 5d 4f 44 3d c1 f2 9d da 33 15 c8 7b DEC 4080 HEX ff0: d5 fa 5a 34 69 d2 9a aa f8 3d 23 58 9d b8 c8 5b DEC 4096 HEX 1000: 3f b4 6e 2c 8f 0f 06 8e dc e8 cd cd 7d fc 58 62 Key length: 80 bits. key: 0x0102030405060708090a
Strombergson & Josefsson Informational [Page 4]
RFC 6229 Test Vectors for the Stream Cipher RC4 May 2011
DEC 0 HEX 0: ed e3 b0 46 43 e5 86 cc 90 7d c2 18 51 70 99 02 DEC 16 HEX 10: 03 51 6b a7 8f 41 3b eb 22 3a a5 d4 d2 df 67 11 DEC 240 HEX f0: 3c fd 6c b5 8e e0 fd de 64 01 76 ad 00 00 04 4d DEC 256 HEX 100: 48 53 2b 21 fb 60 79 c9 11 4c 0f fd 9c 04 a1 ad DEC 496 HEX 1f0: 3e 8c ea 98 01 71 09 97 90 84 b1 ef 92 f9 9d 86 DEC 512 HEX 200: e2 0f b4 9b db 33 7e e4 8b 8d 8d c0 f4 af ef fe DEC 752 HEX 2f0: 5c 25 21 ea cd 79 66 f1 5e 05 65 44 be a0 d3 15 DEC 768 HEX 300: e0 67 a7 03 19 31 a2 46 a6 c3 87 5d 2f 67 8a cb DEC 1008 HEX 3f0: a6 4f 70 af 88 ae 56 b6 f8 75 81 c0 e2 3e 6b 08 DEC 1024 HEX 400: f4 49 03 1d e3 12 81 4e c6 f3 19 29 1f 4a 05 16 DEC 1520 HEX 5f0: bd ae 85 92 4b 3c b1 d0 a2 e3 3a 30 c6 d7 95 99 DEC 1536 HEX 600: 8a 0f ed db ac 86 5a 09 bc d1 27 fb 56 2e d6 0a DEC 2032 HEX 7f0: b5 5a 0a 5b 51 a1 2a 8b e3 48 99 c3 e0 47 51 1a DEC 2048 HEX 800: d9 a0 9c ea 3c e7 5f e3 96 98 07 03 17 a7 13 39 DEC 3056 HEX bf0: 55 22 25 ed 11 77 f4 45 84 ac 8c fa 6c 4e b5 fc DEC 3072 HEX c00: 7e 82 cb ab fc 95 38 1b 08 09 98 44 21 29 c2 f8 DEC 4080 HEX ff0: 1f 13 5e d1 4c e6 0a 91 36 9d 23 22 be f2 5e 3c DEC 4096 HEX 1000: 08 b6 be 45 12 4a 43 e2 eb 77 95 3f 84 dc 85 53
The RC4 algorithm does not meet the basic criteria required for an encryption algorithm, as its output is distinguishable from random. The use of RC4 continues to be recommended against; in particular, its use in new specifications is discouraged. This note is intended only to aid the interoperability of existing specifications that make use of RC4.
Translate documents to 日本語, svenska, Nederlands, Deutsch, français, русский, italiano, español, Tiếng Việt, polski, português, 中文, українська, català, norsk, فارسی, suomi, Bahasa Indonesia, العربية, čeština, 한국어, Bahasa Melayu, magyar, română, српски and other languages.