Title | Algoritma Kriptografi Klasik |
---|---|
Author | Putri Amalia |
Pages | 21 |
File Size | 286.1 KB |
File Type | |
Total Downloads | 427 |
Total Views | 733 |
Algoritma Kriptografi Klasik Pendahuluan Algoritma kriptografi klasik berbasis karakter Menggunakan pena dan kertas saja, belum ada komputer Termasuk ke dalam kriptografi kunci-simetri Algoritma kriptografi klasik: – Cipher Substitusi (Substitution Ciphers) – Cipher Transposisi (Transpositio...
Algoritma Kriptografi Klasik
Pendahuluan
Algoritma kriptografi klasik berbasis karakter Menggunakan pena dan kertas saja, belum ada komputer Termasuk ke dalam kriptografi kunci-simetri Algoritma kriptografi klasik: – –
Cipher Substitusi (Substitution Ciphers) Cipher Transposisi (Transposition Ciphers)
Basic Terms
Plaintext –
–
Info used in cipher known only to sender/receiver
Encipher / Ecnrypt –
Converting plaintext to ciphertext
Study of encryption principles/methods
Cryptanalysis –
Converting ciphertext back to plaintext
Cryptography –
Algorithm for transforming between plaintext and ciphertext
Key
Decipher / Decrypt –
The coded message
Cipher –
The original message
Ciphertext –
Study of principles/methods of dechipering ciphertext without knowing the key
Cryptology –
The field study of both cryptography and cryptanalysis
Symettric-Key Cryptogaphy Also known as
•
•
Private Key Cryptography Secret Key Cryptography
0 1 2 3 4 5 6 7 8 9 10 A B C D E F G H I J K 11 12 13 14 15 16 17 18 19 20 L M N O P Q R S T U 21 22 23 24 25 V W X Y Z
1. Cipher Substitusi
Monoalfabet : setiap karakter chipertext menggantikan satu macam karakter plaintext Polyalfabet : setiap karakter chipertext menggantikan lebih dari satu macam karakter plaintext Monograf /unilateral: satu enkripsi dilakukan terhadap satu karakter plaintext Polygraf /multilateral: satu enkripsi dilakukan terhadap lebih dari satu karakter plaintext
1. Cipher Substitusi - Caesar Cipher
Tiap huruf alfabet digeser 3 huruf ke kanan
pi : A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ci : D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
Contoh: Plainteks: AWASI ASTERIX DAN TEMANNYA OBELIX Cipherteks: DZDVL DVWHULA GDQ WHPDQQBA REHOLA
Caesar Cipher Using K=3 Each letter will be replaced by the 3rd letter after it. AD BE … ZC
Caesar Cipher Example
K=3 Plaintext letter: Ciphertext letter:
Plaintext sample
–
TREATY IMPOSSIBLE
Ciphertext result –
WUHDWB LPSRVVLEOH
ABCDEF … XYZ DEFGHI … ABC
1. Cipher Substitusi - Caesar Cipher
Dalam praktek, cipherteks dikelompokkan ke dalam kelompok n-huruf, misalnya kelompok 4-huruf: DZDV LDVW HULA GDQW HPDQ QBAR EHOL A
Atau membuang semua spasi: DZDVLDVWHULAGDQWHPDQQBAREHOLA
Tujuannya agar kriptanalisis menjadi lebih sulit
Caesar Cipher Math Formula
If we give number to each letter depends on its order, we can write a math formula for this algorithm as follow:
C = E(P) = (P+k) mod (26) P = D(C) = (C-k) mod (26)
Example, K=5 – WAR STARTS TOMORROW – 22 0 17 18 19 0 17 19 14 – 1 5 22 23 24 5 22 24 23 – BFW XYFWYX YTRTXXTB
12 14 17 17 14 22 17 19 23 23 19 1
1. Cipher Substitusi - Vigènere Cipher
Termasuk ke dalam cipher abjad-majemuk (polyalpabetic substitution cipher ). Algoritma tersebut baru dikenal luas 200 tahun kemudian yang oleh penemunya cipher tersebut kemudian dinamakan Vigènere Cipher. Vigènere Cipher menggunakan Bujursangkar Vigènere untuk melakukan enkripsi. Setiap baris di dalam bujursangkar menyatakan huruf-huruf cipherteks yang diperoleh dengan Caesar Cipher.
1. Cipher Substitusi - Vigènere Cipher Plainteks
Ku nci
a b c d e f g h i j K l m n o p q r s t u v w x y z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
Z A B C D E F G H I J K L M N O P Q R S T U V W X Y
Gambar 4.2 Bujursangkar Vigènere
1. Cipher Substitusi - Vigènere Cipher
Contoh penerapan Vigènere Cipher : Plainteks : THIS PLAINTEXT Kunci : sony sonysonys Cipherteks : LVVQ HZNGFHRVL Jika panjang kunci lebih pendek daripada panjang plainteks, maka kunci diulang secara periodik. Dalam hal ini Kunci “sony” diulang sebanyak panjang plaintext-nya Pada dasarnya, setiap enkripsi huruf adalah Caesar cipher dengan kunci yang berbeda-beda. e(‘T’) = (‘T’ + ‘s’) mod 26 = L T = 20 dan s= 19 (20+19)%26=13 L d(‘V’) = (‘V’ - ‘n’) mod 26 = 21 – 13 = 8 I
Playfair cipher
Cont.
Ganti huruf J (bila ada) dengan I Tulis pesan dalam pasangan huruf Jangan sampai ada pasangan huruf yang sama. Jika ada, sisipkan Z ditengahnya Jika jumlah huruf ganjil, tambahkan huruf Z di akhir
2. Cipher Transposisi
Cipherteks diperoleh dengan mengubah posisi huruf di dalam plainteks. Dengan kata lain, algoritma ini melakukan transpose terhadap rangkaian huruf di dalam plainteks. Nama lain untuk metode ini adalah permutasi, karena transpose setiap karakter di dalam teks sama dengan mempermutasikan karakter-karakter tersebut.
2. Cipher Transposisi (Contoh) Contoh: Misalkan plainteks adalah POLITEKNIK ELEKTRONIKA NEGERI SURABAYA Enkripsi: POLITEK NIKELEK TRONIKA NEGERIS URABAYA Cipherteks: (baca secara vertikal) PNTNUOIRERLKOGAIENEBTLIRAEEKIYKKASA PNTN UOIR ERLK OGAI ENEB TLIR AEEK IYKK ASA
Rail Fence Cipher
Write message letters out diagonally over a number of rows, then read off cipher row by row
Example, using plaintext (k=2) –
meet me after the toga party
Write message out as: m e m a t r h t g p r y e t e f e t e o a a t
Giving ciphertext MEMATRHTGPRYETEFETEOAAT
Columnar Transposition
The number of columns is the key information. To encipher: Plaintext is written horizontally in k columns, and is then transcribed vertically columnbycolumn, To decipher: Suppose that the length of the ciphertext is n and the key is k. Then the letters will fill n DIV k full rows, and there will be one partial row at the end with nMODk letters. Transcribing row-byrow will then yield the plaintext.
Example...