ABC (block cipher)
Encyclopedia
In cryptography
Cryptography
Cryptography is the practice and study of techniques for secure communication in the presence of third parties...

, ABC is a block cipher
Block cipher
In cryptography, a block cipher is a symmetric key cipher operating on fixed-length groups of bits, called blocks, with an unvarying transformation. A block cipher encryption algorithm might take a 128-bit block of plaintext as input, and output a corresponding 128-bit block of ciphertext...

 designed in 2002 by Dieter Schmidt.

ABC is a substitution-permutation network
Substitution-permutation network
In cryptography, an SP-network, or substitution-permutation network , is a series of linked mathematical operations used in block cipher algorithms such as AES .Other ciphers that use SPNs are 3-Way, SAFER, SHARK, and Square....

 comprising 17 rounds with 3 different kinds of round functions. The first 8 rounds use XORs, modular multiplications
Modular arithmetic
In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" after they reach a certain value—the modulus....

 as in MMB
MMB
In cryptography, MMB is a block cipher designed by Joan Daemen as an improved replacement for the IDEA cipher. Modular multiplication is the central element in the design...

, and an expanded version of the pseudo-Hadamard transform
Pseudo-Hadamard transform
The pseudo-Hadamard transform is a reversible transformation of a bit string that provides cryptographic diffusion. See Hadamard transform.The bit string must be of even length, so it can be split into two bit strings a and b of equal lengths, each of n bits...

 (PHT) from SAFER
SAFER
In cryptography, SAFER is the name of a family of block ciphers designed primarily by James Massey on behalf of Cylink Corporation. The early SAFER K and SAFER SK designs share the same encryption function, but differ in the number of rounds and the key schedule...

. The middle round uses just XORs and multiplications. The final 8 rounds are similar to the first 8, but using the inverse PHT. ABC's block size
Block size (cryptography)
In modern cryptography, symmetric key ciphers are generally divided into stream ciphers and block ciphers. Block ciphers operate on a fixed length string of bits. The length of this bit string is the block size...

 of 256 bits and key size
Key size
In cryptography, key size or key length is the size measured in bits of the key used in a cryptographic algorithm . An algorithm's key length is distinct from its cryptographic security, which is a logarithmic measure of the fastest known computational attack on the algorithm, also measured in bits...

 of 512 bits are both larger than in typical block cipher algorithms. The key schedule
Key schedule
[[Image:DES-key-schedule.png|thumbnail|220px|The key schedule of DES [[Image:DES-key-schedule.png|thumbnail|220px|The key schedule of DES [[Image:DES-key-schedule.png|thumbnail|220px|The key schedule of DES ("[[Image:DES-key-schedule.png|thumbnail|220px|The key schedule of DES ("...

 is very simple: 256-bit round keys are taken from the key
Key (cryptography)
In cryptography, a key is a piece of information that determines the functional output of a cryptographic algorithm or cipher. Without a key, the algorithm would produce no useful result. In encryption, a key specifies the particular transformation of plaintext into ciphertext, or vice versa...

, which is rotated by a fixed amount in each round.

Sample implementation

This Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

implementation is used in the Encryption Module Pycrypto:
  1. implementation by douglas funnie used in pycrypto

def MAKEITABC(string,key):
key = key+(key[-1]*17)[:17]
string = string+("\x00"*(len(string)-len(key)))
output =
#SPLIT INTO EVEN LENGTH STRINGS USING Pseudo-Hadamard transform
dfhusion = key[:len(key)/2],key[len(key)/2:]
salt = dfhusion[0]+dfhusion[1]+dfhusion[0]+(2*dfhusion[1])[:17]#y
location = 0
for x in range(1,17):
#COMPARE
if location >= x:
location -= 17
#GET LETTAR
startKey = string[location]
#XOR BY KEY
startKey = chr(ord(startKey)^ord(salt[location]))
#OG-MMB BY LOC
startKey = chr(ord(startKey)%(location+1))
if x 8:
salt = salt[::-1]
elif x > 8:
startKey+=salt[::-1]
else:
pass#<8
#ADD TO KEY
output += startKey
location+=1
return output
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK