Talk:CAST-128

{{WikiProject banner shell|class=Start|

{{WikiProject Cryptography|importance=Mid}}

}}

Cast-128 Image

Hello,

i am writing about an image you created for the article about the Cast-128 crypto algorithm. As i studied the specific algorithm, i realized that there is a slight difference between the image and the Request For Comments 2144 where the algorithm is presented.

Copying form the RFC:

Type 1: I = ((Kmi + D) <<< Kri)

f = ((S1[Ia] ^ S2[Ib]) - S3[Ic]) + S4[Id]

Type 2: I = ((Kmi ^ D) <<< Kri)

f = ((S1[Ia] - S2[Ib]) + S3[Ic]) ^ S4[Id]

Type 3: I = ((Kmi - D) <<< Kri)

f = ((S1[Ia] + S2[Ib]) ^ S3[Ic]) - S4[Id]

The RFC also states:

"CAST-128 uses a pair of subkeys per round: a 32-bit quantity Km is

used as a "masking" key and a 5-bit quantity Kr is used as a

"rotation" key."

So i believe that the two sub-keys (Kmi and Kri) should be switched in place in the image. I believe that now the image depicts the opposite argument.

Test Vectors

Moved here from the article [http://en.wikipedia.org/w/index.php?title=CAST-128&diff=542360738&oldid=540473042 (Removed in this edit)]. Wikipedia is not the place for reference documentation like this. -- Sverdrup (talk) 11:55, 6 March 2013 (UTC)

Test vectors :

Below is a sample test vector, providing the input and the expected output for the above algorithm. Even, the values of Key Schedule, Km and Kr is provided for both encryption and decryption.

Encryption :

128-bit key = 01 23 45 67 12 34 56 78 23 45 67 89 34 56 78 9A

plaintext = 01 23 45 67 89 AB CD EF

ciphertext = 23 8B 4F E5 84 7E 44 B2

class="wikitable"
iK[i]Km[i]Kr[i]
1BC173E26BC173E2600000015
278A207EF78A207EF0000001B
3ECE0A7F5ECE0A7F500000001
47CB0FB6B7CB0FB6B00000005
5A5D2D636A5D2D63600000003
6D78B9407D78B94070000001F
756C069D356C069D30000001F
882E8240C82E8240C0000001C
9335437493354374900000010
108813D5C78813D5C70000001F
11B9FCD732B9FCD73200000012
1259106B3659106B3600000001
13496AF1A9496AF1A90000001D
1418F8DC4318F8DC4300000019
158D9DEF0F8D9DEF0F00000001
1683EDA38483EDA3840000000F

Decryption :

128-bit key = 01 23 45 67 12 34 56 78 23 45 67 89 34 56 78 9A

plaintext = 23 8B 4F E5 84 7E 44 B2

ciphertext = 01 23 45 67 89 AB CD EF

class="wikitable"
iK[i]Km[i]Kr[i]
1BC173E26BC173E2600000015
278A207EF78A207EF0000001B
3ECE0A7F5ECE0A7F500000001
47CB0FB6B7CB0FB6B00000005
5A5D2D636A5D2D63600000003
6D78B9407D78B94070000001F
756C069D356C069D30000001F
882E8240C82E8240C0000001C
9335437493354374900000010
108813D5C78813D5C70000001F
11B9FCD732B9FCD73200000012
1259106B3659106B3600000001
13496AF1A9496AF1A90000001D
1418F8DC4318F8DC4300000019
158D9DEF0F8D9DEF0F00000001
1683EDA38483EDA3840000000F

Attack vectors?

One topic found in other crypto articles is a section discussing known or suspected attack vectors. Even for ciphers considered secure, cryptanalysis research might suggest theoretical avenues of attack, and this would be interesting to note in the article for anyone researching the cipher. Any experts care to add? 137.254.4.10 (talk) 23:09, 13 February 2015 (UTC)