International Data Encryption Algorithm


IDEA mengenkripsi 64-bit plainteks menjadi blok 64-bit cipherteks dengan menggunakan 128-bit masukan kunci K. IDEA menggunakan jaringan Feistel pada umumnya. Pengulangan r menggunakan enam dengan 16 bit subkey Ki(r), 1≤ i ≤6, untuk mentrasformasikan 64-bit masukan X menjadi keluaran empat dengan 16-bit blok, untuk input selanjutnya. Dengan menggunakan pengulangan sebanyak 8 kali maka akan diperoleh keluaran trasformasi tersebut, dengan menggunakan 4 subkey tambahan Ki(9), 1≤ i ≤ 4 untuk mengasikan cipherteks Y=(Y1,Y2,Y3,Y4)

Key Schedule

Masukan: 128-bit kunci K = k1…K128

Keluaran: 52 16-bit kunci sub-blok Ki(r) dengan pengulangan r

  1. Buat subkey K1(1) …K6(1), K1(2)…K6(2),…, K1(8)…K6(8),K1(9)…K4(9)

  2. Bagi K menjadi delapan dengan 16-bit blok, dab langsung menjadi 8 subkey yang pertama

  3. Ikuti langkah diatas sehingga menjadi 52 subkey, lakukan putaran secara cyclic kekiri sebanyan 25 bit bagi menjadi 8 blok.

Enkripsi

Masukan: 64-bit plainteks M = m1 … m64; 128–bit key K=k1 … k128

Keluaran : 64-bit cipherteks blok Y = Y(Y1,Y2,Y3,Y4)

  1. (key schedule) Mengkomputasikan 16 bit subkeys K1(r), …. , K6(r) untuk putaran atau pengulangan 1 ≤ r ≤ 8, dan K1(9), … , K4(9)

  2. (X1,X2,X3,X4) ← (m1 … m16,m17 … m32,m33 … m48,m49 … m64), dimana X1 adalah 16-bit data masukan

  3. Untuk putaran 1 sampai 8 lakukan :

    1. X1 ←X1K1(r), X4 ←X4K4(r), X2 ←X2K2(r), X3 ←X3K3(r).

    2. t0 ← K3(r)(X13), t1 ← K6(r)(t0X24), t2 ←t0t1

    3. X1 ← X1 t1, X4 ← X4 t2, a ← X2 t2, X2 ← X3 t1, X3 ←a

  4. (keluaran transformasi) Y1 ←X1K1(9), Y4 ←X4K4(9), Y2 ←X3K2(9), Y3 ←X2K3(9).

Dekripsi

Untuk dekripsi algoritma yang digunakan sama dengan algoritma yang digunakan pada enkripsi, tetapi yang perlu diperhatikan adalan key schedule yang berubah sesuai dengan aturan yang ada dibawah ini:

Tabel 2.2 Key schedule untuk dekripsi IDEA

putaran r

K1(r)

K2(r)

K3(r)

K4(r)

K5(r)

K6(r)

r = 1

(K1(10-r))-1

-K2(10-r)

-K3(10-r)

(K4(10-r))-1

-K5(9-r)

-K6(9-r)

2 ≤ r ≤ 8

(K1(10-r))-1

-K3(10-r)

-K2(10-r)

(K4(10-r))-1

-K5(9-r)

-K6(9-r)

r = 9

(K1(10-r))-1

-K2(10-r)

-K3(10-r)

K4(10-r))-1

[outputciph_idea] = enkripsi_idea(inputplain_idea, kunci_idea)

[outputplain_idea] = dekripsi_idea(inputciph_idea, kunci_idea)

invers_kali.m dan invers_tambah.m ==> fungsi pendukung untuk dekripsi

link download
http://www.mathworks.com/matlabcentral/fileexchange/49060-international-data-encryption-algorithm

Advertisements

Author: ridhobustami

orang ngak jelas

4 thoughts on “International Data Encryption Algorithm”

  1. Hello Ridho,
    I am Ajay from India. I really appreciate your work on idea algorithm implemented on MATLAB. However, I am facing some difficulties, I hope you can help me with them. I also tried to contact you via the mathswork portal but there seems to be some problem with the system.

    Can you please tell me what are the values I need to use for inputplain_idea, and kunci_idea while calling the function [outputciph_idea] = enkripsi_idea(inputplain_idea, kunci_idea);

    I am getting an error:
    ??? Index exceeds matrix dimensions.
    Error in ==> enkripsi_idea at 86
    X(i,:)=bit_masuk(1,16*i-15:16*i);
    Error in ==> ideaenc at 24
    [outputciph_idea] = enkripsi_idea(inputplain_idea, kunci_idea);

    I have also messaged the same problem to your facebook profile.
    Thanks and regards.

  2. Hello Ajay,
    you can input “inputplain_idea” with binary matrix which has length 64 and “kunci_idea” with binary matrix which has length 128.
    I will give you example:

    ===================================================================================================================================================
    %for encryption
    kunci_idea= round(rand(1,64));
    inputplain_idea= round(rand(1,128));
    [outputciph_idea] = enkripsi_idea(inputplain_idea, kunci_idea);
    ===================================================================================================================================================
    %for Decryption
    inputciph_idea=outputciph_idea;
    [outputplain_idea] = dekripsi_idea(inputciph_idea, kunci_idea)
    ===================================================================================================================================================

    I hope that it will be helpful, please fell free if you have question

  3. Hey Ridho,
    I have made a new file with content:

    %for encryption
    kunci_idea= round(rand(1,64));
    inputplain_idea= round(rand(1,128));
    [outputciph_idea] = enkripsi_idea(inputplain_idea, kunci_idea);

    %for Decryption
    inputciph_idea=outputciph_idea;
    [outputplain_idea] = dekripsi_idea(inputciph_idea, kunci_idea)

    Still I am getting this error.
    ??? Index exceeds matrix dimensions.

    Error in ==> enkripsi_idea at 24
    Z(i,:,1)=subkeyrot(1,16*i-15:16*i);

    Error in ==> idearidhosol at 4
    [outputciph_idea] = enkripsi_idea(inputplain_idea, kunci_idea);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s