Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Khafre

created by Teiresias

(idea) by Teiresias (1.4 wk) (print)   ?   (I like it!) Tue Oct 31 2000 at 15:52:04

The Cryptosystem

Khafre is another encryption system from Ralph Merkle and is very similar to one of his other cryptosystems known as Khufu, in that is consists of a 64 bit plaintext that is split into two 32 bit halves and then cycled through S-Boxes for a period of time,it but unlike Khufu, the S-Boxes used in Khafre are not computed as a part of the encryption process. Instead, Khafre selects its S-Boxes from a standard set. Using standard S-Boxes also means that some new mechanism of mixing in key material must be adopted because the standard S-boxes can not serve as the key. The workaround for this problem involves the key materials being XORed into the first 64 bits of the data block before the first encryption cycle, and every 8 cycles afterwards. This does mean, however, that all key lengths for Khafre have to be a multiple of 64. Below is the pseudocode for the Khafre system

   L, R: int32;
standardSBoxes: ARRAY {1 .. enough/8} OF ARRAY {0 .. 255} OF int32;
key: ARRAY {0 .. enoughKey-1} OF ARRAY {0 .. 1} of int32: keyIndex: {0 .. enoughKey-1}; rotateSchedule: ARRAY {1 .. 8} := {16,16,8,8,16,16,24,24}; L := L XOR key{0}{0}; R := R XOR key{0}{1}; keyIndex := 1 MOD enoughKey; round := 1;
octet := 1;
WHILE (round Begin
L := L XOR standardSBoxesoctet {R AND #FF};
R := RotateRight{R, rotateSchedule{round mod 8 + 1}};
SWAP{L,R};
IF round MOD 8 = 0 THEN
BEGIN
L := L XOR RotateRight{ key{keyIndex}{0}, octet};
R := R XOR RotateRight{ key{keyIndex}{1}, octet};
keyIndex := keyIndex + 1;
IF keyIndex = enoughKey THEN keyIndex := 0;
octet := octet + 1;
END;
round := round + 1;
End;
IF keyIndex # 0 THEN ERROR;

Code taken from A Software Encryption Function by Ralph C. Merkle,
(available at http://www.cryptocd.org/cryptocd/source/cyphers/khufu/c/merkle/1.txt)

Khafre requires more cycles of encryption to approach the level of security offered by Khufu due to its use of standard S-Boxes, and due to its more complex key inclusion method, each cycle takes more computation, but the fact that Khafre doesn't used computational power to create custom S-Boxes, it runs faster for small amounts of plaintext.


The Person

Khafre (also known as Rakhaef or Chephren) was the son of Khufu(better known as Cheops), and ruled from 2520 - 2494 BC. He was responsible for the creation of the second largest pyramid complex at Giza, and also as the pharoh under whom the Sphinx was created. His reign was succeeded by an, as yet, unknown king.


printable version
chaos

Khufu Ralph Merkle strong cryptography XP Whore
encryption I can't find my feeding tube Cheops Great Pyramid of Giza
American Psycho The Lion, The Hunter and the Serpent IFF Cryptology
Climbing the Pyramids key mechanism Pseudocode
S-Box Mandelbrot set Hausdorff dimension plaintext
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
The best nodes of all time:
Choosing fresh fruit
Salvia divinorum
Much Ado About Nothing
Solar sail
Belgium
Capoeira
Is there a kind of information you're better off not having?
The Ten Commandments
Tulipomania
The Badlands
Bait al-Hikmah
Rio Negro massacres: background
Chicago Fire Department
New Writeups
SwimmingMonkey
Conversations with Fo Fo- the Loneliest dog in Purgatory(fiction)
locke baron
lynx(thing)
Simulacron3
Reality, Dimensions and the Natural Ontology(essay)
SubSane
Making Love to a 9-Foot Woman(person)
Ouzo
Thoughts(idea)
antigravpussy
I fall silent, listening. The breadcrumbs are talking about us(person)
calgon
Buffalo Bill by the pool(poetry)
gate
Anarchy is Order(idea)
ushdfgakjasgh
Scribeling(thing)
XWiz
Trism(review)
artman2003
Briefcase Full of Souls - Part I(fiction)
Dreamvirus
Alan Ladd(person)
waverider37
Harold Holt(person)
The Debutante
Until death do us part(fiction)
Ysardo
a brother to a sister(personal)
This affordable entertainment brought to you by The Everything Development Company