You are on page 1of 15

Encryption Algorithm (Part II)

Irvanizam Zamanhuri, M.Sc l Computer Science Study Program l Syiah Kuala University l http://www.informatika.unsyiah.ac.id/irvanizam l Email: irvanizam.zamanhuri@informatika.unsyiah.ac.id
l

Metode Affin Chiper


Karakter = Pi Kunci = a,k Enkripsi Ci=((a x Pi) +k )mod 26 Deskripsi Pi=1/a(Ci-k) mod 26 Indeks dimulai dari nilai 0 Nilai k sebarang Akan tetapi syarat a Gcd(a,n)=1

Contoh
Kunci : 5,15 Pesan :PAGI Chiperteks? Plainteks? Kunci:7,8 Pesan : MAKIN

Metode Hill Chiper


Kunci adalah matriks bujursangkar dengan determinan misalnya d, mempunyai syarat gcd(d,26)=1 Enkripsi Plain Teks = P Kunci berukuran K x K Plain teks diblok setiap k karakter

Metode Hill Chiper


Perkalian matriks key dari plain teks Dibentuk matriks dengan banyak kolom k dan setiap baris adalah masing masing blok Dimulai dari indeks 0 C= P K mod n P= C K-1 mod n

Contoh
Pesan : SIANG Kunci :

2 3 1 1

Pesan : SEMOGA Kunci:

11 8 3 7

Example 3
Consider the message 'ACT', and the key below (or GYBNQKURP in letters): K = Since 'A' is 0, 'C' is 2 and 'T' is 19, the message is the vector: P= Thus the enciphered vector is given by: C=KP

which corresponds to a ciphertext of 'POH'.

Now, suppose that our message is instead 'CAT', or: P= This time, the enciphered vector is given by: C = K P

which corresponds to a ciphertext of 'FIN'.

Dekripsi
P = K-1 C K-1 = Taking the previous example ciphertext of 'POH', we get:

which gets us back to 'ACT',

Determinant of Matrix Key


The matrix will have an inverse if and only if its determinant is not zero, and does not have any common factors with the modular base. D=

Transposisi
Merubah posisi karakter dalam plainteks Plain teks dan chiperteks berasal dari alphabet yang sama. Teknik transposisi standar 1.Bagi plain teks ke dalam blok blok 2.Lakukan permutasi karakter

Transposisi zigzag

Transformasi segitiga

You might also like