Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Does any one have, or can refer to a Known-Answer-Test (KAT) for Triple DES Keying Option 2?

(Keying Option 2 means $C = DES_{k_1}(DES^{-1}_{k_2}(DES_{k_1}(P)))$ for encryption and $P = DES^{-1}_{k_1}(DES_{k_2}(DES^{-1}_{k_1}(C)))$ for decryption, where $k_1$ and $k_2$ are independent parts of the key bundle.)

I have developed an implementation of 3DES Keying Option 2 in a FOSS library called TurboPower Lockbox (or at SourceForge). I need some KAT vectors to validate my implementation. I've done a good search, but every 3DES KAT I have found has either been KO-1 or KO-3.

share|improve this question
    
Note that the current recommendation is to use three distinct (independent) keys, so KO 2 is effectively deprecated. That said, you simply can generate those test vectors using any other implementation, as 3DES is deterministic. –  Paŭlo Ebermann Oct 9 '11 at 16:22

1 Answer 1

up vote 5 down vote accepted
<------------- key -------------> <-- plaintext -> <- ciphertext ->
E62CABB93D1F3BDC 524FDF91A279C297 DD16B3D004069AB3 8ADDBD2290E565CE
B619F870574A9E80 DAE6AB34C22CD626 058B92A4B28FB4EB A53DDC6B3098008F
6132C42C3E5E94EF 7A5152BF19AB739D 91993307EFBFB13C D13105386083E517
0245EAFE62DF92BF E319C29E9E2C3EA1 58BAA732CF5DBD77 EF37441D1FE7B73A
C2EF5B10C26BAE61 2664BCE9F1E6678C E6539DD7FF082367 1450D5FEA38AEB80
9164EF70A1DA8002 9875919B388A2386 A306B4FA17417641 36860A444636D894
85D3868FB6D3E3A4 5E49AE348FC14CDF 4A7AF41AF573E96A BD40F7FE6F44F9EF
73F17638DA806EE6 76167A19978CDCC8 7741413CC96285A8 6A0FBE802F7201C8
614F13F758EFE3D6 A4028A0702298FE6 18E7B44F456FF0FD 5C22BB4EE13D9EAB
37DF2940C1A71FD3 3ED6D55B4F62EC0B 7290AE96E197BDCE DF2AB90A93749022
7C9B2F7FB08F68DC 4F195E62584F6779 D5A0AE1359DA867D 8E52C2B4E863254F
EA1662E65E016246 541CEA73857C85C1 460AE2C7D633E6D4 1205FF7D77AD8BD7
CD622C38AD20A8D0 45737540A140A894 4261EF04E3EF1FA6 25A35491A64F933C
C7CEFDB54CD64AFE 1FD94FBF6DB54A79 0E1695B86577A126 9B21B03FBD3E82D4
B6802F19897091B3 D32FFE07C7928004 169E98D23D301AF0 7924CA4928EC63F3
8ADCE5D67C2362CE 5B2376450707E64A A0C0C08A691277A3 C45FFFDEB5756EED
6E10F8D59E833E13 45133EFE4CC726F4 373928EB771F9BB3 31F85A488D07CF90
153825B51937FD6D 7045798F238A5D3D F122797888ABAFA2 1181B20CE8CDBBE3
2AB316029E1992D0 CBF28C73BF45B09B 973D159070EC7ACD 624A453179136E97
46F180BCC4EF7F20 150E86FD94CEAE40 A7288180FB1FEFC7 20B1424D7048708B
1F83AD5D0B01BF32 CB45CBB9A11FE697 D45BDA6460A9AA4B B553F96B77B1A6AB
0B5BDC91326497E6 A862CD1FDAD079C8 EE130547D6265B81 AF97031793011FFA
C47F3EE6194F6DAE 6DBCEA917ADFF4EA DE3A800A50E8C249 EF729ABF30074603
8CC10D641638022C 465BAB75DA208310 37DFF73950840F03 3EED09DF8EF37F3D
E35E0ED55D13511F 5D5764233479155E F0A6401B4B66542B 56BB3F2A1054A1B3
FD025EE061262913 58374FC43DCB3BFB 2B45D67D85CF0D86 42F8CFEFE6E28C6C
<------------- key -------------> <-- plaintext -> <- ciphertext ->

Edit: In this KAT that I just generated, the keys are random (with odd parity), the plaintext is random, and the ciphertext has been computed using a command-line tool I wrote many years ago, often use, and trust, for it produce results that I have checked against many independent implementations, including its handling of two-keys triple-DES which is still a de-facto standard in the Smart Card indusry. The script used as a wrapper to this tool is so simple that it's not quite impossible that I got it right :-)

My comments in the source code says:

Our reference description for the DES is the book:
    Security for computer networks
    D.W. Davies and W.L.Price
    John Wiley & sons
    May 1987 (brown) edition
The authors give an exhaustive description of the DES algorithm, starting page 54
note: there is a typo in table 3.6 on page 58, where last value in the S4 box
should be 14, not 12.

I remember that I caught the misprint with a KAT.

share|improve this answer
    
Thanks a bunch. –  Sean B. Durkin Oct 10 '11 at 12:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.