Back to IF4020 Kriptografi

GOST, RC5, RC6, dan Cipher Blok Lainnya

Questions/Cues

  • Apa itu GOST (Magma) dan apa bedanya dengan DES?
  • Bagaimana key schedule dan fungsi GOST bekerja?
  • Apa yang khas dari RC5 (parameter variabel, operasi rotasi bergantung data)?
  • Bagaimana RC6 memperluas RC5?
  • Apa ciri Blowfish, Serpent, Twofish, dan MARS?
  • Cipher simetri mana yang direkomendasikan?

Reference Points

  • IF4020 Kriptografi — Review Beberapa Block Cipher, Bagian 3: GOST, RC5, RC6, Serpent, dll (Slides 2-37)

Legenda warna diagram dan tabel:

  • ■ Ungu: kotak-S / operasi non-linier (confusion)
  • ■ Teal: rotasi / pergeseran (diffusion)
  • ■ Oranye: XOR (⊕) dan penjumlahan modular (⊞)
  • ■ Abu-abu putus-putus: kunci dan kunci putaran
  • ■ Biru: struktur Feistel
  • ■ Hijau: keluaran / pilihan yang direkomendasikan
  • ■ Merah: tidak aman / tidak disarankan

GOST (Magma)

GOST = Gosudarstvenny Standard (“standar pemerintah”), tercantum dalam GOST 28147-89 (RFC 5830). Cipher blok standar Uni Soviet, dikembangkan 1970 tetapi baru dirilis publik 1990 setelah Uni Soviet bubar; dibuat sebagai alternatif DES. Pada standar baru GOST R 34.12-2015 (RFC 7801, 8891) cipher ini bernama Magma; standar itu juga menetapkan cipher blok 128-bit Kuznyechik. Struktur mirip DES: jaringan Feistel.

  • Blok 64 bit, kunci 256 bit, 32 putaran.
  • Hanya ada 8 kunci putaran (, tiap 32 bit, hasil membagi kunci 256 bit menjadi 8 bagian); penjadwalan pada 32 putaran: tiga kali (putaran 1-24), lalu terbalik (putaran 25-32). Contoh kunci abcdefghijklmnopqrstuvwxyz123456: = abcd, = efgh, …, = 3456.
Putaran12345678
1-8
9-16
17-24
25-32

Baris teal: delapan putaran terakhir memakai kunci terbalik. Tidak ada komputasi key schedule sama sekali, hanya pemotongan dan pengurutan.

Satu putaran: , . Fungsi :

  1. Penjumlahan modulo : (32 bit).
  2. Substitusi: dibagi 8 bagian 4 bit, masing-masing ke kotak-S (8 kotak, tiap kotak permutasi 0..15; 4 bit masuk, 4 bit keluar). Contoh S1: masukan 0010 (2) elemen ke-2 = 9 = 1001.
  3. Geser sirkuler kiri 11 bit hasil gabungan 32 bit, lalu XOR dengan .
flowchart TD
    R["R(i-1)<br/>32 bit"] --> ADD(("⊞<br/>mod 2³²"))
    KI["Ki (32 bit)"] -.-> ADD
    ADD --> SB["8 kotak-S<br/>4 → 4 bit"]
    SB --> ROT["⋘ 11"]
    ROT --> X(("⊕"))
    L["L(i-1)"] --> X
    X --> RI["Ri"]
    R --> LI["Li = R(i-1)"]
    classDef plain fill:#ffffff,stroke:#7a8699,color:#15202e
    classDef key fill:#eef0f4,stroke:#7a8699,stroke-dasharray:4 3,color:#15202e
    classDef rnd fill:#e3e8fb,stroke:#4f6bed,stroke-width:2px,color:#15202e
    classDef sub fill:#efe7fb,stroke:#8a4fd6,stroke-width:2px,color:#15202e
    classDef perm fill:#dcf1f3,stroke:#1f8fa3,stroke-width:2px,color:#15202e
    classDef xor fill:#fbeadb,stroke:#d9731a,stroke-width:2px,color:#b4570f
    classDef out fill:#dff3e8,stroke:#2f9e63,stroke-width:2px,color:#15202e
    class R,L plain
    class ADD,X xor
    class KI key
    class SB sub
    class ROT perm
    class RI,LI out
    linkStyle 7 stroke:#4f6bed,stroke-width:2.5px

Bandingkan dengan fungsi DES (DES dan Triple DES): tidak ada ekspansi, kunci dicampur dengan penjumlahan (bukan XOR), dan P-box diganti satu rotasi 11 bit. Garis biru: jalur silang Feistel.

Dekripsi kebalikan enkripsi (Feistel dari “bawah” ke “atas”).

Perbedaan GOST vs DES:

AspekDESGOST
Kunci56 bit256 bit (brute force jauh lebih sukar)
Putaran1632
Kotak-S bit bit
Key schedulerumitsederhana
Permutasitak teratur (P-box)geser sirkuler 11 bit

RC5

Dibuat Ronald Rivest (1994), RSA Laboratories; RC6 (finalis AES) dikembangkan darinya. Khas: ukuran blok, panjang kunci, dan jumlah putaran semuanya variabel.

ParameterSimbolNilai
Ukuran word (blok = 2 word)16, 32, 64 bit
Jumlah putaran0..255
Panjang kunci (byte)0..255 (0 sampai 2040 bit)

Kunci putaran: word . Kunci disalin ke larik ( word), lalu diinisialisasi dengan konstanta dari dan (rasio emas):

, . Akhirnya dan dicampur sebanyak iterasi (penjumlahan, rotasi 3, rotasi bergantung ).

Enkripsi (blok 64 bit, dan masing-masing 32 bit):

Cipherteks = gabungan dan . Kekhasan: rotasi bergantung data (, ).

flowchart TD
    A["A"] --> X1(("⊕"))
    B["B"] --> X1
    X1 --> R1["⋘ B"]
    B -. jumlah rotasi .-> R1
    R1 --> P1(("⊞"))
    S1["S[2i]"] -.-> P1
    P1 --> A2["A baru"]
    B --> X2(("⊕"))
    A2 --> X2
    X2 --> R2["⋘ A"]
    A2 -. jumlah rotasi .-> R2
    R2 --> P2(("⊞"))
    S2["S[2i+1]"] -.-> P2
    P2 --> B2["B baru"]
    classDef plain fill:#ffffff,stroke:#7a8699,color:#15202e
    classDef key fill:#eef0f4,stroke:#7a8699,stroke-dasharray:4 3,color:#15202e
    classDef rnd fill:#e3e8fb,stroke:#4f6bed,stroke-width:2px,color:#15202e
    classDef sub fill:#efe7fb,stroke:#8a4fd6,stroke-width:2px,color:#15202e
    classDef perm fill:#dcf1f3,stroke:#1f8fa3,stroke-width:2px,color:#15202e
    classDef xor fill:#fbeadb,stroke:#d9731a,stroke-width:2px,color:#b4570f
    classDef out fill:#dff3e8,stroke:#2f9e63,stroke-width:2px,color:#15202e
    class A,B plain
    class X1,X2,P1,P2 xor
    class R1,R2 perm
    class S1,S2 key
    class A2,B2 out
    linkStyle 3,10 stroke:#d6454f,stroke-width:2.5px,stroke-dasharray:4 3

Hanya tiga operasi: ⊕, ⊞, dan ⋘ (teal). Garis merah putus-putus: besar rotasi diambil dari data ( bit terendah dari atau ), bukan konstanta. Itulah sumber non-linieritas RC5, karena tidak ada S-box.

RC6

Dibuat Rivest, Robshaw, Sidney, dan Yin (RSA Labs, 1998) untuk kompetisi AES. Pengembangan RC5: blok 128 bit (4 register berukuran bit), kunci 128, 192, 256 hingga 2040 bit, key schedule identik dengan RC5. Operasi: XOR, penjumlahan, rotasi, plus perkalian. Dapat dipandang sebagai dua RC5 paralel. Fungsi .

B = B + S[0];  D = D + S[1]
for i = 1 to r:
    t = (B * (2B + 1)) <<< lg w
    u = (D * (2D + 1)) <<< lg w
    A = ((A xor t) <<< u) + S[2i]
    C = ((C xor u) <<< t) + S[2i + 1]
    (A, B, C, D) = (B, C, D, A)
A = A + S[2r + 2];  C = C + S[2r + 3]
flowchart TD
    B["B"] --> FB["f(B) = B(2B+1)<br/>⋘ lg w"] --> T["t"]
    D["D"] --> FD["f(D) = D(2D+1)<br/>⋘ lg w"] --> U["u"]
    A["A"] --> XA(("⊕ t")) --> RA["⋘ u"] --> PA(("⊞ S[2i]")) --> AN["A'"]
    C["C"] --> XC(("⊕ u")) --> RC["⋘ t"] --> PC(("⊞ S[2i+1]")) --> CN["C'"]
    T -.-> XA
    U -.-> XC
    U -.-> RA
    T -.-> RC
    AN --> SW["(A,B,C,D) ← (B,C,D,A)"]
    CN --> SW
    classDef plain fill:#ffffff,stroke:#7a8699,color:#15202e
    classDef key fill:#eef0f4,stroke:#7a8699,stroke-dasharray:4 3,color:#15202e
    classDef rnd fill:#e3e8fb,stroke:#4f6bed,stroke-width:2px,color:#15202e
    classDef sub fill:#efe7fb,stroke:#8a4fd6,stroke-width:2px,color:#15202e
    classDef perm fill:#dcf1f3,stroke:#1f8fa3,stroke-width:2px,color:#15202e
    classDef xor fill:#fbeadb,stroke:#d9731a,stroke-width:2px,color:#b4570f
    classDef out fill:#dff3e8,stroke:#2f9e63,stroke-width:2px,color:#15202e
    class A,B,C,D,T,U plain
    class FB,FD sub
    class XA,XC,PA,PC xor
    class RA,RC perm
    class AN,CN out
    class SW rnd

Dua jalur RC5 berdampingan: dan , tetapi rotasinya disilangkan ( dirotasi oleh dari , oleh dari ). Perkalian (ungu) menggantikan S-box sebagai sumber non-linieritas.

Dekripsi membalik langkah (pengurangan, rotasi kanan). Rotasi memakai bit terendah dari operan.

Cipher Blok Lainnya

CipherPerancangBlokKunciPutaranCatatan
BlowfishBruce Schneier (1993)64 bit32-448 bit164 S-box, substitusi-permutasi
SerpentAnderson, Biham, Knudsen128 bit128/192/25632finalis AES, 8 S-box; IP awal, linear transformation
TwofishBruce Schneier128 bits.d. 25616finalis AES; penerus Blowfish; 5 S-box
MARSIBM128 bit128-448 (langkah 32)32finalis AES; forward mixing, backward mixing

Pengelompokan menurut struktur:

flowchart LR
    CB["Cipher blok"] --> FE["Feistel<br/>(separuh blok per putaran)"]
    CB --> SPN["SPN<br/>(seluruh blok per putaran)"]
    FE --> F1["DES, 3DES"]
    FE --> F2["GOST / Magma"]
    FE --> F3["Blowfish, Twofish"]
    FE --> F4["RC5, RC6, MARS<br/>(varian Feistel)"]
    SPN --> S1["AES / Rijndael"]
    SPN --> S2["Serpent"]
    SPN --> S3["Kuznyechik"]
    classDef root fill:#eef0f4,stroke:#7a8699,color:#15202e
    classDef fei fill:#e3e8fb,stroke:#4f6bed,stroke-width:2px,color:#15202e
    classDef spn fill:#efe7fb,stroke:#8a4fd6,stroke-width:2px,color:#15202e
    class CB root
    class FE,F1,F2,F3,F4 fei
    class SPN,S1,S2,S3 spn

■ Biru = Feistel (dekripsi = enkripsi dengan kunci terbalik), ■ ungu = SPN (dekripsi butuh lapisan invers).

Rekomendasi Cipher Simetri (ringkasan slide)

CipherPembuatPanjang kunciKeterangan
BlowfishSchneier1-448 bitold and slow
DESIBM56 bittoo weak to use now
IDEAMassey dan Xuejia128 bitgood, but patented
RC4Rivest1-2048 bitcaution: some keys are weak
RC5Rivest128-256 bitgood, but patented
RijndaelDaemen dan Rijmen128-256 bitbest choice
SerpentAnderson, Biham, Knudsen128-256 bitvery strong
Triple DESIBM168 bitsecond best choice
TwofishSchneier128-256 bitvery strong; widely used

Hijau = direkomendasikan, merah = hindari (tabel ini dari slide; saat ini 3DES juga sudah di-deprecate NIST, lihat DES dan Triple DES).

Summary

GOST (Magma): cipher Feistel Soviet, blok 64 bit, kunci 256 bit, 32 putaran, hanya 8 kunci putaran yang dijadwalkan; fungsi = penjumlahan mod 8 kotak-S 44 geser sirkuler 11 bit. Dibanding DES: kunci lebih panjang, putaran lebih banyak, key schedule sederhana, tanpa P-box. RC5 (Rivest, 1994) berparameter variabel (, , ) dengan rotasi bergantung data: , kunci putaran word dari konstanta /. RC6 (finalis AES) memperluasnya ke blok 128 bit (4 register, dua RC5 paralel) dengan tambahan perkalian . Cipher lain: Blowfish (64-bit blok, kunci s.d. 448), Serpent (32 putaran), Twofish, MARS (finalis AES). Dari daftar rekomendasi: Rijndael pilihan terbaik, 3DES kedua, sedangkan DES terlalu lemah. Dari sini materi bergeser ke kriptografi kunci publik.