<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by muhfalihr on Medium]]></title>
        <description><![CDATA[Stories by muhfalihr on Medium]]></description>
        <link>https://medium.com/@muhammadfalihromadhoni?source=rss-4edc1f6edb5c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ya4tGuLOFKxiVMbuUX3BRA.jpeg</url>
            <title>Stories by muhfalihr on Medium</title>
            <link>https://medium.com/@muhammadfalihromadhoni?source=rss-4edc1f6edb5c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 18:30:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muhammadfalihromadhoni/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ArgoCD Image Updater with Write Back Target Kustomization]]></title>
            <link>https://medium.com/@muhammadfalihromadhoni/otomatisasi-gitops-panduan-implementasi-argocd-image-updater-dengan-strategi-digest-b169b63ffc65?source=rss-4edc1f6edb5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b169b63ffc65</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[kustomize]]></category>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[muhfalihr]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 08:29:17 GMT</pubDate>
            <atom:updated>2026-02-05T08:01:17.000Z</atom:updated>
            <content:encoded><![CDATA[<p>Dalam ekosistem GitOps, menjaga sinkronisasi antara container registry dan manifest Kubernetes adalah tantangan tersendiri. Melakukan update tag image secara manual (misalnya dari v1.0 ke v1.1) pada repository Git setiap kali ada rilis baru bisa menjadi pekerjaan yang repetitif, memakan waktu, dan rentan terhadap human error.</p><p>Artikel ini akan membahas langkah-langkah mengimplementasikan <strong>ArgoCD Image Updater</strong>, sebuah komponen pendukung ArgoCD yang secara otomatis memonitor container registry dan melakukan commit perubahan versi image terbaru langsung ke Git repository Anda.</p><h3>Gambaran Infrastruktur &amp; Teknologi</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8sldMVELS9X3oUlYO7vJlg.png" /><figcaption>Automated GitOps Pipeline with ArgoCD Image Updater (Write-Back Strategy)</figcaption></figure><p>Sebelum kita masuk ke tahap implementasi, panduan ini disusun berdasarkan skenario infrastruktur yang sudah berjalan dengan stack teknologi sebagai berikut:</p><ul><li><strong>Kubernetes:</strong> Sebagai platform orkestrasi tempat aplikasi berjalan.</li><li><strong>GitLab:</strong> Digunakan sebagai Source Code Management (SCM) untuk menyimpan kode aplikasi dan manifest deployment (Git Repository).</li><li><strong>ArgoCD:</strong> Bertindak sebagai GitOps controller yang menyinkronkan state di GitLab ke dalam cluster Kubernetes.</li><li><strong>Kustomize:</strong> Digunakan untuk manajemen konfigurasi manifest (overlay), memungkinkan kita memisahkan konfigurasi base dan modifikasi spesifik lingkungan (patching).</li></ul><p>Kita akan mengintegrasikan ArgoCD Image Updater ke dalam stack di atas dengan menggunakan <strong>Strategi Update Berbasis Digest (SHA)</strong>. Strategi ini dipilih untuk memastikan immutability dan keamanan yang lebih baik, di mana aplikasi akan selalu merujuk pada unique hash dari image container, bukan sekadar tag yang bisa berubah-ubah.</p><h3>Prasyarat Sistem &amp; Akses</h3><p>Sebelum memulai implementasi, pastikan lingkungan infrastruktur Anda telah memenuhi kriteria berikut agar integrasi berjalan mulus:</p><h3>1. Kubernetes Cluster</h3><p>Anda memiliki akses administratif ke cluster (via kubectl) untuk membuat Secret dan ConfigMap.</p><h3>2. ArgoCD Terpasang</h3><p>ArgoCD sudah terinstall dan berjalan stabil (biasanya di namespace argocd). Aplikasi yang ingin diotomatisasi juga sudah didaftarkan (registered) di ArgoCD.</p><h3>3. Repository di GitLab</h3><ul><li>Manifest deployment tersimpan di GitLab.</li><li>Anda memiliki <strong>Personal Access Token (PAT)</strong> atau <strong>Project Access Token</strong> GitLab dengan izin <strong>Write/Push</strong> (scope: write_repository atau api). Token ini diperlukan agar updater bisa melakukan commit otomatis kembali ke repo.</li></ul><h3>4. Struktur Kustomize yang Valid</h3><p>Ini adalah poin krusial. Manifest aplikasi Anda harus dikelola menggunakan <strong>Kustomize</strong>, dan definisi image <strong>wajib</strong> menggunakan field images: di dalam file kustomization.yaml.</p><p><strong>Contoh struktur yang benar:</strong></p><pre># kustomization.yaml<br>images:<br>  - name: image_placeholder_name<br>    newName: quay.io/my-org/my-app<br>    newTag: main</pre><blockquote><em>⚠️ </em><strong><em>Penting:</em></strong><em> Jika image hanya di-hardcode di dalam </em><em>deployment.yaml tanpa didefinisikan di </em><em>kustomization.yaml, ArgoCD Image Updater tidak akan bisa memperbarui tag-nya.</em></blockquote><h3>5. Kredensial Registry</h3><p>Username dan Password (atau Token) untuk mengakses container registry tempat image aplikasi Anda disimpan (misalnya Quay.io, Docker Hub, atau GitLab Container Registry).</p><h3>Langkah 1: Instalasi ArgoCD Image Updater</h3><p>Langkah pertama adalah men-deploy manifest stabil dari ArgoCD Image Updater ke dalam namespace argocd.</p><pre>kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argocd-image-updater/stable/config/install.yaml</pre><h3>Langkah 2: Konfigurasi Kredensial (Secrets)</h3><p>Agar updater dapat membaca container registry (untuk cek versi baru) dan menulis ke Git repository (untuk update manifest), kita perlu membuat Kubernetes Secret.</p><h3>A. Secret untuk Container Registry</h3><p>Buat secret berisi kredensial login ke container registry Anda.</p><pre>kubectl create secret generic registry-creds \<br>  --from-literal=creds=&lt;user&gt;:&lt;pass/token&gt; \<br>  -n argocd</pre><h3>B. Secret untuk Git Repository (Write-Back)</h3><p>Secret ini digunakan agar ArgoCD Image Updater memiliki izin untuk melakukan git push.</p><p><strong>1. Buat Secret:</strong></p><pre>kubectl create secret generic git-https-creds \<br>  --from-literal=username=&lt;git-username&gt; \<br>  --from-literal=password=&lt;git-token&gt; \<br>  --type=kubernetes.io/basic-auth \<br>  -n argocd</pre><p><strong>2. Tambahkan Label Khusus:</strong></p><p>ArgoCD membutuhkan label spesifik agar mengenali secret ini sebagai kredensial repositori. Edit secret tersebut:</p><pre>kubectl edit secret git-https-creds -n argocd</pre><p>Pastikan bagian metadata memiliki label berikut:</p><pre>metadata:<br>  labels:<br>    argocd.argoproj.io/secret-type: repo-creds<br>  name: git-https-creds<br>  namespace: argocd</pre><h3>Langkah 3: Konfigurasi Global Image Updater</h3><p>Kita perlu mengonfigurasi bagaimana updater berperilaku, termasuk template pesan commit dan konfigurasi registry. Edit ConfigMap argocd-image-updater-config.</p><pre>kubectl edit configmap argocd-image-updater-config -n argocd</pre><p>Sesuaikan isinya seperti berikut:</p><pre>apiVersion: v1<br>kind: ConfigMap<br>metadata:<br>  name: argocd-image-updater-config<br>  namespace: argocd<br>  labels:<br>    app.kubernetes.io/name: argocd-image-updater-config<br>    app.kubernetes.io/part-of: argocd-image-updater-controller<br>data:<br>  # Konfigurasi Git Commit<br>  git.commit-message-template: |<br>    feat: configure ArgoCD Image Updater for automated image updates<br>  git.email: &lt;git-email&gt;<br>  git.user: &lt;git-user&gt;<br>  <br>  # Interval Pengecekan (Default 2 menit)<br>  interval: 2m0s<br>  <br>  # Konfigurasi Logging<br>  log.format: text<br>  log.level: debug<br>  <br>  # Batas Concurrency<br>  max_concurrent_apps: &quot;10&quot;<br>  <br>  # Konfigurasi Registry &amp; Mapping Kredensial<br>  registries.conf: |<br>    registries:<br>      - name: docker.io<br>        api_url: https://registry-1.docker.io<br>        prefix: docker.io<br>        credentials: secret:argocd/registry-creds#creds</pre><blockquote><em>📝 </em><strong><em>Catatan:</em></strong><em> Format </em><em>credentials mengarah ke Secret yang kita buat di Langkah 2A (</em><em>registry-creds).</em></blockquote><h3>Langkah 4: Persiapan Aplikasi (Deployment &amp; Kustomization)</h3><p>Agar write-back berfungsi dengan Kustomize, struktur manifest aplikasi Anda harus sudah mendefinisikan image dengan benar.</p><h3>File kustomization.yaml:</h3><p>Pastikan Anda menggunakan field images untuk mendefinisikan image dasar.</p><pre>apiVersion: kustomize.config.k8s.io/v1beta1<br>kind: Kustomization</pre><pre>images:<br>  - name: image_myproject-svc-docling-serve-cu126<br>    newName: quay.io/docling-project/docling-serve-cu126<br>    newTag: main # Tag awal</pre><h3>File deployment.yaml:</h3><p>Gunakan nama placeholder yang sesuai dengan name di kustomization.</p><pre>spec:<br>  template:<br>    spec:<br>      containers:<br>        - name: docling-container<br>          image: image_myproject-svc-docling-serve-cu126</pre><h3>Langkah 5: Membuat Resource ImageUpdater</h3><p>Ini adalah inti dari konfigurasi. Kita akan membuat Custom Resource ImageUpdater yang memberitahu ArgoCD aplikasi mana yang harus dipantau dan strategi apa yang digunakan.</p><p>Buat file myproject-updater.yaml:</p><pre>apiVersion: argocd-image-updater.argoproj.io/v1alpha1<br>kind: ImageUpdater<br>metadata:<br>  name: myproject-svc-all-updater<br>  namespace: argocd<br>spec:<br>  namespace: argocd<br>  # Konfigurasi Write-Back ke Git<br>  writeBackConfig:<br>    method: git:secret:argocd/git-https-creds<br>    gitConfig:<br>      repository: https://git.myproject.id/application-myproject/myproject.git<br>      branch: master<br>      writeBackTarget: &quot;kustomization&quot;<br>  # Target Aplikasi<br>  applicationRefs:<br>    - namePattern: &quot;app-myproject&quot; # Nama aplikasi di ArgoCD Dashboard<br>      images:<br>        - alias: &quot;docling-serve-cu126&quot;<br>          imageName: &quot;quay.io/docling-project/docling-serve-cu126:main&quot;<br>          commonUpdateSettings:<br>            forceUpdate: true<br>            # Menggunakan strategi digest untuk kepastian versi<br>            updateStrategy: &quot;digest&quot; <br>          manifestTargets:<br>            kustomize:<br>              name: image_myproject-svc-docling-serve-cu126</pre><p>Apply konfigurasi tersebut:</p><pre>kubectl apply -f myproject-updater.yaml</pre><h3>Langkah 6: Verifikasi dan Monitoring</h3><p>Setelah semua terkonfigurasi, ArgoCD Image Updater akan berjalan secara berkala (sesuai interval di ConfigMap). Untuk memastikan proses berjalan lancar, cek logs dari pod controller.</p><pre>kubectl logs -n argocd -l app.kubernetes.io/name=argocd-image-updater-controller -f</pre><h3>Analisis Log Sukses</h3><p>Jika konfigurasi benar, Anda akan melihat log seperti di bawah ini:</p><pre>level=info msg=&quot;Starting image update cycle, considering 1 application(s) for update&quot; ...<br>level=debug msg=&quot;Processing application&quot; application=argocd/app-myproject-prod ...<br>level=debug msg=&quot;Considering this image for update&quot; image_name=quay.io/... image_tag=main ...<br>level=debug msg=&quot;Transport cache HIT for https://quay.io...&quot;<br>level=debug msg=&quot;Image ... already on latest allowed version&quot; ...</pre><p>Log di atas menunjukkan bahwa:</p><ol><li>Controller berhasil mendeteksi aplikasi app-myproject-prod.</li><li>Berhasil terhubung ke registry quay.io.</li><li>Membandingkan digest image lokal dengan yang ada di registry.</li><li>Jika ada perbedaan, updater akan melakukan commit ke Git repository Anda.</li></ol><h3>Kesimpulan</h3><p>Dengan mengimplementasikan ArgoCD Image Updater, Anda telah mengotomatisasi salah satu bagian paling krusial dalam pipeline CI/CD. Pengembang cukup melakukan push image baru ke registry, dan cluster Kubernetes akan memperbarui dirinya sendiri secara otomatis melalui GitOps, menjaga single source of truth tetap di Git.</p><h3>Referensi &amp; Dokumentasi Resmi</h3><p>Untuk pendalaman lebih lanjut mengenai konfigurasi yang digunakan dalam panduan ini, Anda dapat merujuk pada dokumentasi resmi ArgoCD Image Updater berikut:</p><h3>1. Instalasi &amp; Setup Dasar</h3><p><a href="https://argocd-image-updater.readthedocs.io/en/stable/install/cmd/run/"><strong>Installation Guide</strong></a> — Panduan lengkap mengenai metode instalasi, termasuk manifest install.yaml yang kita gunakan di langkah awal.</p><h3>2. Konfigurasi Inti</h3><ul><li><a href="https://argocd-image-updater.readthedocs.io/en/stable/basics/update-strategies/"><strong>Update Strategies</strong></a> — Penjelasan mendalam mengenai berbagai strategi update (semver, latest, name, digest). Referensi ini penting untuk memahami mengapa kita menggunakan strategi digest dalam tutorial ini.</li><li><a href="https://argocd-image-updater.readthedocs.io/en/stable/configuration/applications/"><strong>Application Configuration</strong></a> — Detail mengenai cara mendefinisikan target aplikasi, baik menggunakan Annotations pada ArgoCD App maupun menggunakan CRD ImageUpdater seperti yang kita praktekkan.</li></ul><h3>3. Keamanan &amp; Kredensial</h3><ul><li><a href="https://argocd-image-updater.readthedocs.io/en/stable/basics/authentication/"><strong>Authentication</strong></a> — Dokumentasi krusial yang membahas cara mengatur akses ke Private Container Registry dan Git Write-Back (HTTPS/SSH), termasuk format Secret yang benar.</li><li><a href="https://argocd-image-updater.readthedocs.io/en/stable/configuration/registries/"><strong>Registry Configuration</strong></a> — Panduan untuk mengonfigurasi registries.conf di ConfigMap, mengatur API URL untuk registry spesifik (seperti Docker Hub, Quay, ECR, GCR), dan mapping kredensial.</li></ul><h3>4. Konfigurasi Lanjutan</h3><p><a href="https://argocd-image-updater.readthedocs.io/en/stable/configuration/images/#appendix"><strong>Image Configuration &amp; Appendix</strong></a> — Referensi teknis untuk parameter spesifik pada level image, seperti pengaturan alias, pola regex untuk tag, dan opsi update lanjutan.</p><p><em>Selamat mencoba! Jika Anda memiliki pertanyaan atau mengalami kendala saat implementasi, jangan ragu untuk meninggalkan komentar di bawah.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b169b63ffc65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Memecahkan Kode Rahasia: Eksplorasi Cryptography dari Zaman Romawi ke Era Digital]]></title>
            <link>https://medium.com/@muhammadfalihromadhoni/memecahkan-kode-rahasia-eksplorasi-cryptography-dari-zaman-romawi-ke-era-digital-50d92e30bca0?source=rss-4edc1f6edb5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/50d92e30bca0</guid>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[muhfalihr]]></dc:creator>
            <pubDate>Mon, 13 Oct 2025 18:12:51 GMT</pubDate>
            <atom:updated>2025-10-13T18:12:51.513Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pengantar</h3><p>Laporan merupakan hasil kegiatan eksplorasi mandiri dari perkuliahan Pengantar Informatika dan Komputasi untuk Pertemuan Ketujuh tentang Keamanan Informasi di Program Studi Informatika, Universitas Pelita Harapan. Tulisan ini disusun oleh Muhammad Falih Romadhoni, Yusep Muhammad Zazuli, dan Vick Rab Wilbert. Pada tugas eksplorasi ini, kami mempelajari beberapa metode “<em>Cryptography</em>” melalui situs <a href="https://www.cryptool.org/">https://www.cryptool.org</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JNvfz9LSJaGFEmbHXcP3_w.png" /><figcaption><strong>Gambar 1.</strong> <a href="https://www.cryptool.org/">Tampilan CrypTool Portal</a></figcaption></figure><h3>Definisi dan Kategori Cryptography</h3><h3>Definisi <em>Cryptography</em></h3><p>Definisi “<em>Cryptography</em>” adalah ilmu dan seni untuk mengamankan informasi dan komunikasi melalui penggunaan kode-kode tertentu sehingga hanya pihak yang memiliki kunci atau metode dekripsi yang tepat yang dapat membaca dan memproses informasi tersebut. Cryptography bertujuan untuk melindungi kerahasiaan (<em>confidentiality</em>), keutuhan (<em>integrity</em>), dan autentikasi (<em>authentication</em>) data dalam komunikasi digital maupun non-digital.</p><h3>Kategori dalam Cryptography</h3><p>Berdasarkan eksplorasi kami di situs CrypTool, terdapat tiga kategori utama dalam cryptography:</p><ul><li>Secara general, yang termasuk kategori <strong>Cypher</strong> adalah metode yang menggunakan algoritma matematika atau substitusi sistematis untuk mengubah plaintext (teks asli) menjadi ciphertext (teks terenkripsi) dengan tujuan menyembunyikan makna asli dari pesan, di mana proses enkripsi dan dekripsi memerlukan kunci rahasia.</li><li>Sedangkan yang termasuk metode <strong>Codings</strong> adalah metode yang mengubah representasi data dari satu format ke format lain untuk tujuan tertentu seperti efisiensi transmisi, kompatibilitas sistem, atau standardisasi, tanpa <em>necessarily </em>bertujuan untuk keamanan atau kerahasiaan.</li><li>Sementara <strong>Cryptanalysis</strong> adalah ilmu dan teknik untuk memecahkan atau menganalisis sistem enkripsi tanpa mengetahui kunci, dengan tujuan menemukan kelemahan dalam algoritma cipher atau mendapatkan plaintext dari ciphertext melalui berbagai metode analisis.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BDq-RdezZ-T1-sfHNjZTKw.png" /><figcaption><strong>Gambar 2. </strong>Generate by Gemini</figcaption></figure><h3>Pemilihan Metode untuk Eksplorasi</h3><p>Untuk kategori “Cypher”, kami memilih 3 metode yang akan kami bahas lebih lanjut yaitu: AES (<em>Advanced Encryption Standard</em>), Caesar Cipher, dan Vigenère Cipher. Kami memilih AES karena merupakan standar enkripsi modern yang paling banyak digunakan saat ini, Caesar Cipher karena merupakan cipher klasik yang sederhana namun fundamental untuk memahami konsep dasar enkripsi, dan Vigenère Cipher karena merupakan pengembangan dari Caesar yang menunjukkan evolusi teknik enkripsi <em>polyalphabetic</em>.</p><p>Sedangkan untuk kategori Codings, 1 metode yang akan kami bahas adalah Base64. Kami memilih Base64 karena sangat umum digunakan dalam aplikasi web modern untuk encoding data biner.</p><p>Untuk kategori Cryptanalysis, 1 metode yang akan kami bahas adalah Frequency Analysis. Kami memilih metode ini karena merupakan teknik fundamental dalam cryptanalysis yang efektif untuk memecahkan cipher substitusi sederhana.</p><h3>Metode A: AES (Advanced Encryption Standard)</h3><h3>Sejarah Singkat</h3><p>AES dikembangkan oleh dua kriptografer Belgia, Joan Daemen dan Vincent Rijmen, dengan nama asli Rijndael. Pada tahun 1997, NIST (<em>National Institute of Standards and Technology</em>) Amerika Serikat memulai kompetisi untuk mencari pengganti DES (<em>Data Encryption Standard</em>). Setelah evaluasi ketat selama beberapa tahun, Rijndael dipilih sebagai pemenang pada Oktober 2000 dan secara resmi menjadi standar federal AS pada November 2001.</p><h3>Definisi Singkat</h3><p>AES adalah algoritma enkripsi blok simetris yang menggunakan kunci yang sama untuk enkripsi dan dekripsi. AES beroperasi pada blok data berukuran 128 bit dan mendukung panjang kunci 128, 192, atau 256 bit, yang masing-masing disebut AES-128, AES-192, dan AES-256.</p><h3>Cara Kerja / Algoritma</h3><p>AES bekerja melalui serangkaian transformasi yang disebut “<em>rounds</em>”. Jumlah round bergantung pada panjang kunci: 10 rounds untuk AES-128, 12 untuk AES-192, dan 14 untuk AES-256. Setiap round terdiri dari empat operasi utama:</p><ol><li><strong>SubBytes</strong>: Substitusi non-linear setiap byte menggunakan S-box</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*mtKYrUOUe2eOmc-jM-ZLUw.png" /><figcaption><strong>Gambar 3.</strong> <a href="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf">Illustration of SUBBYTES()</a></figcaption></figure><p>2. <strong>ShiftRows</strong>: Pergeseran siklis baris-baris dalam state array</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*eJmGb9bunxdsCJkEV1J6hw.png" /><figcaption><strong>Gambar 4.</strong> <a href="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf">Illustration of SHIFTROWS()</a></figcaption></figure><p>3. <strong>MixColumns</strong>: Transformasi linear yang mencampur kolom-kolom (kecuali round terakhir)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*3aUE_PGGhbm3ctA4Rbt-Yg.png" /><figcaption><strong>Gambar 5.</strong> <a href="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf">Illustration of MIXCOLUMNS()</a></figcaption></figure><p>4. <strong>AddRoundKey</strong>: XOR dengan round key yang diturunkan dari kunci utama</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*XJHZ_thN6JffaR03rMrgUw.png" /><figcaption><strong>Gambar 6.</strong> <a href="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf">Illustration of ADDROUNDKEY()</a></figcaption></figure><p>Proses dimulai dengan AddRoundKey awal, dilanjutkan dengan rounds transformasi, dan diakhiri dengan round final tanpa MixColumns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*ZIMkpGChVwgCYDsX.png" /><figcaption><strong>Gambar 7.</strong> <a href="https://en.wikipedia.org/wiki/Advanced_Encryption_Standard">AES (Rijndael) Round Function</a></figcaption></figure><h3>Contoh Implementasi Python</h3><pre># Contoh sederhana AES menggunakan library Cryptodome<br># pip install pycryptodome<br><br>from Crypto.Cipher import AES<br>from Crypto.Random import get_random_bytes<br>from Crypto.Util.Padding import pad, unpad<br>import base64<br><br>def encrypt_AES(plaintext, key):<br>    &quot;&quot;&quot;Enkripsi plaintext menggunakan AES-CBC&quot;&quot;&quot;<br>    # Generate random initialization vector<br>    iv = get_random_bytes(16)<br>    <br>    # Create cipher object<br>    cipher = AES.new(key, AES.MODE_CBC, iv)<br>    <br>    # Pad plaintext to multiple of 16 bytes<br>    padded_text = pad(plaintext.encode(), 16)<br>    <br>    # Encrypt<br>    ciphertext = cipher.encrypt(padded_text)<br>    <br>    # Return IV + ciphertext (both needed for decryption)<br>    return base64.b64encode(iv + ciphertext).decode()<br><br>def decrypt_AES(encrypted_data, key):<br>    &quot;&quot;&quot;Dekripsi ciphertext menggunakan AES-CBC&quot;&quot;&quot;<br>    # Decode from base64<br>    encrypted_bytes = base64.b64decode(encrypted_data)<br>    <br>    # Extract IV (first 16 bytes) and ciphertext<br>    iv = encrypted_bytes[:16]<br>    ciphertext = encrypted_bytes[16:]<br>    <br>    # Create cipher object<br>    cipher = AES.new(key, AES.MODE_CBC, iv)<br>    <br>    # Decrypt and unpad<br>    decrypted = unpad(cipher.decrypt(ciphertext), 16)<br>    <br>    return decrypted.decode()<br><br><br># Contoh penggunaan<br>key = get_random_bytes(16)  # Generate random 128-bit key<br>message = &quot;Ini adalah pesan rahasia&quot;<br><br>encrypted = encrypt_AES(message, key)<br>print(f&quot;Encrypted: {encrypted}&quot;)<br><br>decrypted = decrypt_AES(encrypted, key)<br>print(f&quot;Decrypted: {decrypted}&quot;)</pre><h3>Manfaat / Keuntungan</h3><ol><li>Keamanan tinggi — hingga saat ini tidak ada serangan praktis yang berhasil</li><li>Efisiensi komputasi baik dalam hardware maupun software</li><li>Standar internasional yang diterima secara luas</li><li>Fleksibilitas dalam pemilihan panjang kunci</li><li>Resistant terhadap berbagai jenis serangan kriptografis</li></ol><h3>Kelemahan / Batasan</h3><ol><li>Memerlukan manajemen kunci yang baik</li><li>Rentan terhadap side-channel attacks jika implementasi tidak hati-hati</li><li>Tidak cocok untuk enkripsi streaming real-time tanpa mode operasi khusus</li><li>Memerlukan padding untuk data yang bukan kelipatan 128 bit</li></ol><h3>Contoh Aplikasi Nyata</h3><p>AES digunakan secara luas dalam protokol HTTPS untuk mengamankan komunikasi web, enkripsi file dalam sistem operasi modern, dan berbagai aplikasi keamanan seperti VPN dan komunikasi messaging terenkripsi.</p><h3>Metode B: Caesar Cipher</h3><h3>Sejarah Singkat</h3><p>Caesar Cipher dinamai berdasarkan Julius Caesar (100 SM — 44 SM), pemimpin militer dan politik Romawi yang menggunakan cipher ini untuk mengenkripsi pesan militer rahasia. Menurut catatan sejarah oleh Suetonius, Caesar menggunakan pergeseran 3 huruf untuk korespondensi pribadinya. Ini merupakan salah satu cipher substitusi paling awal yang tercatat dalam sejarah.</p><h3>Definisi Singkat</h3><p>Caesar Cipher adalah cipher substitusi monoalphabetic sederhana di mana setiap huruf dalam plaintext diganti dengan huruf lain yang berada pada posisi tetap dalam alfabet. Pergeseran ini ditentukan oleh kunci yang merupakan angka antara 1–25 untuk alfabet Latin.</p><h3>Cara Kerja / Algoritma</h3><p>Algoritma Caesar Cipher sangat sederhana:</p><ol><li>Tentukan nilai kunci (shift) antara 1–25</li><li>Untuk enkripsi: Geser setiap huruf plaintext sebanyak nilai kunci ke kanan</li><li>Untuk dekripsi: Geser setiap huruf ciphertext sebanyak nilai kunci ke kiri</li><li>Jika pergeseran melewati Z, kembali ke A (operasi modulo 26)</li></ol><p>Rumus matematika:</p><ul><li>Enkripsi: E(x) = (x + k) mod 26</li><li>Dekripsi: D(x) = (x — k) mod 26</li></ul><p>Dimana x adalah posisi huruf (A=0, B=1, …, Z=25) dan k adalah kunci.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*J9TkX5BIdu7PdWpL.png" /><figcaption><strong>Gambar 8.</strong> <a href="https://en.wikipedia.org/wiki/Caesar_cipher">The action of a Caesar cipher</a></figcaption></figure><h3>Contoh Implementasi Python</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*bqPzXWGhZAzBKBVc" /><figcaption><strong>Gambar 9.</strong> <a href="https://www.boxentriq.com/code-breaking/caesar-cipher">Caesar Cipher example</a></figcaption></figure><pre>def caesar_encrypt(plaintext, key):<br>    &quot;&quot;&quot;Enkripsi plaintext menggunakan Caesar Cipher&quot;&quot;&quot;<br>    result = &quot;&quot;<br>    <br>    for char in plaintext:<br>        if char.isalpha():<br>            # Tentukan base (A atau a)<br>            base = ord(&#39;A&#39;) if char.isupper() else ord(&#39;a&#39;)<br>            <br>            # Shift karakter dan wrap around jika perlu<br>            shifted = (ord(char) - base + key) % 26<br>            result += chr(base + shifted)<br>        else:<br>            # Non-alphabetic characters remain unchanged<br>            result += char<br>    <br>    return result<br><br>def caesar_decrypt(ciphertext, key):<br>    &quot;&quot;&quot;Dekripsi ciphertext menggunakan Caesar Cipher&quot;&quot;&quot;<br>    # Dekripsi adalah enkripsi dengan negative key<br>    return caesar_encrypt(ciphertext, -key)<br><br>def caesar_bruteforce(ciphertext):<br>    &quot;&quot;&quot;Brute force attack pada Caesar Cipher&quot;&quot;&quot;<br>    print(&quot;Trying all possible keys:&quot;)<br>    for key in range(26):<br>        decrypted = caesar_decrypt(ciphertext, key)<br>        print(f&quot;Key {key:2}: {decrypted}&quot;)<br><br><br># Contoh penggunaan<br>plaintext = &quot;HELLO WORLD&quot;<br>key = 3<br><br>encrypted = caesar_encrypt(plaintext, key)<br>print(f&quot;Plaintext: {plaintext}&quot;)<br>print(f&quot;Key: {key}&quot;)<br>print(f&quot;Encrypted: {encrypted}&quot;)<br><br>decrypted = caesar_decrypt(encrypted, key)<br>print(f&quot;Decrypted: {decrypted}&quot;)<br><br># Demonstrasi brute force<br>print(&quot;\n--- Brute Force Attack ---&quot;)<br>caesar_bruteforce(&quot;KHOOR ZRUOG&quot;)</pre><h3>Manfaat / Keuntungan</h3><ol><li>Sangat sederhana untuk diimplementasikan dan dipahami</li><li>Cepat dalam eksekusi</li><li>Baik untuk pembelajaran konsep dasar kriptografi</li><li>Tidak memerlukan resource komputasi yang besar</li></ol><h3>Kelemahan / Batasan</h3><ol><li>Sangat lemah — hanya 25 kemungkinan kunci</li><li>Mudah dipecahkan dengan brute force</li><li>Rentan terhadap frequency analysis</li><li>Pola bahasa tetap terlihat dalam ciphertext</li><li>Tidak cocok untuk penggunaan keamanan modern</li></ol><h3>Contoh Aplikasi Nyata</h3><p>Caesar Cipher saat ini hanya digunakan untuk tujuan pendidikan atau permainan seperti ROT13 dalam forum online untuk menyembunyikan spoiler. Dalam geocaching, Caesar Cipher sering digunakan untuk memberikan petunjuk dalam “<em>treasure hunt</em>”.</p><h3>Metode C: Vigenère Cipher</h3><h3>Sejarah Singkat</h3><p>Vigenère Cipher dikembangkan oleh kriptolog Perancis Blaise de Vigenère pada abad ke-16 (lahir 15 April 1523, meninggal 1596). Cipher ini merupakan pengembangan dari Caesar Cipher dan untuk waktu yang lama dianggap tidak dapat dipecahkan, sehingga dijuluki “<em>le chiffre indéchiffrable</em>” (cipher yang tidak dapat dipecahkan). Baru pada tahun 1863, Friedrich Wilhelm Kasiski berhasil mempublikasikan metode untuk memecahkan Vigenère Cipher.</p><h3>Definisi Singkat</h3><p>Vigenère Cipher adalah cipher substitusi polyalphabetic yang menggunakan rangkaian Caesar Cipher berdasarkan huruf-huruf dari kata kunci. Berbeda dengan Caesar Cipher yang menggunakan shift tunggal, Vigenère menggunakan shift yang berbeda untuk setiap posisi karakter berdasarkan kunci yang berulang.</p><h3>Cara Kerja / Algoritma</h3><p>Langkah-langkah Vigenère Cipher:</p><ol><li>Pilih kata kunci (contoh: “KEY”)</li><li>Ulangi kunci sepanjang plaintext</li><li>Untuk setiap karakter plaintext: Tentukan shift berdasarkan karakter kunci yang bersesuaian, Aplikasikan Caesar Cipher dengan shift tersebut.</li><li>Untuk dekripsi, lakukan proses sebaliknya</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*NdwqNTIjNXJGNmEs" /><figcaption><strong>Gambar 10.</strong> <a href="https://www.wikihow.com/Encode-and-Decode-Using-the-Vig%C3%A8nere-Cipher">Vigenere Cipher</a></figcaption></figure><p>Contoh:</p><pre>Plaintext:  ATTACKATDAWN<br>Key:        LEMONLEMONLE<br>Ciphertext: LXFOPVEFRNHR</pre><h3>Contoh Implementasi Python</h3><pre>def vigenere_encrypt(plaintext, key):<br>    &quot;&quot;&quot;Enkripsi plaintext menggunakan Vigenère Cipher&quot;&quot;&quot;<br>    plaintext = plaintext.upper().replace(&quot; &quot;, &quot;&quot;)<br>    key = key.upper()<br>    ciphertext = &quot;&quot;<br>    key_index = 0<br>    <br>    for char in plaintext:<br>        if char.isalpha():<br>            # Calculate shift from key character<br>            shift = ord(key[key_index % len(key)]) - ord(&#39;A&#39;)<br>            <br>            # Apply Caesar shift<br>            encrypted_char = chr((ord(char) - ord(&#39;A&#39;) + shift) % 26 + ord(&#39;A&#39;))<br>            ciphertext += encrypted_char<br>            <br>            key_index += 1<br>        else:<br>            ciphertext += char<br>    <br>    return ciphertext<br><br>def vigenere_decrypt(ciphertext, key):<br>    &quot;&quot;&quot;Dekripsi ciphertext menggunakan Vigenère Cipher&quot;&quot;&quot;<br>    ciphertext = ciphertext.upper().replace(&quot; &quot;, &quot;&quot;)<br>    key = key.upper()<br>    plaintext = &quot;&quot;<br>    key_index = 0<br>    <br>    for char in ciphertext:<br>        if char.isalpha():<br>            # Calculate shift from key character<br>            shift = ord(key[key_index % len(key)]) - ord(&#39;A&#39;)<br>            <br>            # Apply reverse Caesar shift<br>            decrypted_char = chr((ord(char) - ord(&#39;A&#39;) - shift) % 26 + ord(&#39;A&#39;))<br>            plaintext += decrypted_char<br>            <br>            key_index += 1<br>        else:<br>            plaintext += char<br>    <br>    return plaintext<br># Contoh penggunaan<br>plaintext = &quot;DIES IST EIN GEHEIMER TEXT&quot;<br>key = &quot;KEY&quot;<br><br>print(f&quot;Plaintext: {plaintext}&quot;)<br>print(f&quot;Key: {key}&quot;)<br><br>encrypted = vigenere_encrypt(plaintext, key)<br>print(f&quot;Encrypted: {encrypted}&quot;)<br><br>decrypted = vigenere_decrypt(encrypted, key)<br>print(f&quot;Decrypted: {decrypted}&quot;)<br><br># Format output dalam blok 5<br>def format_blocks(text, block_size=5):<br>    &quot;&quot;&quot;Format text dalam blok-blok&quot;&quot;&quot;<br>    text = text.replace(&quot; &quot;, &quot;&quot;)<br>    return &#39; &#39;.join([text[i:i+block_size] for i in range(0, len(text), block_size)])<br><br>print(f&quot;Formatted: {format_blocks(encrypted)}&quot;)</pre><h3>Manfaat / Keuntungan</h3><ol><li>Lebih kuat dari Caesar Cipher karena polyalphabetic</li><li>Resistant terhadap simple frequency analysis</li><li>Fleksibilitas dalam pemilihan panjang kunci</li><li>Mudah diimplementasikan tanpa teknologi modern</li><li>Keamanan meningkat dengan panjang kunci</li></ol><h3>Kelemahan / Batasan</h3><ol><li>Rentan terhadap Kasiski examination untuk menemukan panjang kunci</li><li>Setelah panjang kunci diketahui, dapat dipecahkan dengan frequency analysis</li><li>Kunci yang berulang menciptakan pola dalam ciphertext</li><li>Tidak aman untuk penggunaan modern</li></ol><h3>Contoh Aplikasi Nyata</h3><p>Vigenère Cipher digunakan secara luas dalam Perang Saudara Amerika dan masih digunakan hingga awal abad ke-20. Saat ini hanya digunakan untuk tujuan pendidikan dan puzzle kriptografi.</p><h3>Metode D: Base64</h3><h3>Sejarah Singkat</h3><p>Base64 dikembangkan pada awal era internet sebagai bagian dari MIME (<em>Multipurpose Internet Mail Extensions</em>) standard pada tahun 1987. Diciptakan untuk mengatasi keterbatasan protokol email SMTP yang awalnya hanya mendukung karakter 7-bit ASCII. Base64 memungkinkan data biner untuk ditransmisikan melalui sistem yang hanya mendukung teks.</p><h3>Definisi Singkat</h3><p>Base64 adalah skema encoding yang merepresentasikan data biner dalam format ASCII string menggunakan 64 karakter yang dapat dicetak. Base64 bukan enkripsi karena tidak menggunakan kunci dan dapat dengan mudah di-decode tanpa informasi rahasia.</p><h3>Cara Kerja / Algoritma</h3><p>Proses encoding Base64:</p><ol><li>Ambil 3 byte (24 bit) dari input</li><li>Bagi menjadi 4 grup 6-bit</li><li>Konversi setiap grup 6-bit menjadi karakter Base64</li><li>Jika input tidak kelipatan 3, tambahkan padding “=”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*DLs3nVJj080ytcPu" /><figcaption><strong>Gambar 11.</strong> <a href="https://b64encode.com/blog/base64-algorithm/">Base64 Encoding in 4 simple steps</a></figcaption></figure><p>Tabel karakter Base64:</p><ul><li>A-Z (indeks 0–25)</li><li>a-z (indeks 26–51)</li><li>0–9 (indeks 52–61)</li><li>(indeks 62)</li><li>/ (indeks 63)</li><li>= (padding)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/0*tFjkzU7We5MI34vf" /><figcaption><strong>Gambar 12.</strong> <a href="https://www.analyticsvidhya.com/blog/2025/05/base64/">standard Base64 character table</a></figcaption></figure><h3>Contoh Implementasi Python</h3><pre>import base64<br><br>def manual_base64_encode(data):<br>    &quot;&quot;&quot;Manual implementation of Base64 encoding&quot;&quot;&quot;<br>    # Base64 character set<br>    base64_chars = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/&quot;<br>    <br>    # Convert string to bytes if needed<br>    if isinstance(data, str):<br>        data = data.encode(&#39;utf-8&#39;)<br>    <br>    result = &quot;&quot;<br>    i = 0<br>    <br>    while i &lt; len(data):<br>        # Take 3 bytes (or less if at end)<br>        byte1 = data[i]<br>        byte2 = data[i + 1] if i + 1 &lt; len(data) else 0<br>        byte3 = data[i + 2] if i + 2 &lt; len(data) else 0<br>        <br>        # Combine into 24-bit number<br>        combined = (byte1 &lt;&lt; 16) | (byte2 &lt;&lt; 8) | byte3<br>        <br>        # Extract 4 6-bit values<br>        index1 = (combined &gt;&gt; 18) &amp; 63<br>        index2 = (combined &gt;&gt; 12) &amp; 63<br>        index3 = (combined &gt;&gt; 6) &amp; 63<br>        index4 = combined &amp; 63<br>        <br>        # Convert to Base64 characters<br>        result += base64_chars[index1]<br>        result += base64_chars[index2]<br>        <br>        # Handle padding<br>        if i + 1 &lt; len(data):<br>            result += base64_chars[index3]<br>        else:<br>            result += &quot;=&quot;<br>            <br>        if i + 2 &lt; len(data):<br>            result += base64_chars[index4]<br>        else:<br>            result += &quot;=&quot;<br>        <br>        i += 3<br>    <br>    return result<br><br><br># Contoh penggunaan<br>text = &quot;ABBA&quot;<br>print(f&quot;Original: {text}&quot;)<br><br># Using Python&#39;s built-in base64<br>encoded_builtin = base64.b64encode(text.encode()).decode()<br>print(f&quot;Encoded (built-in): {encoded_builtin}&quot;)<br><br># Using manual implementation<br>encoded_manual = manual_base64_encode(text)<br>print(f&quot;Encoded (manual): {encoded_manual}&quot;)<br><br># Decode<br>decoded = base64.b64decode(encoded_builtin).decode()<br>print(f&quot;Decoded: {decoded}&quot;)<br><br># Demonstrasi dengan data biner<br>binary_data = bytes([0x00, 0xFF, 0xAA, 0x55])<br>encoded_binary = base64.b64encode(binary_data).decode()<br>print(f&quot;\nBinary data: {binary_data.hex()}&quot;)<br>print(f&quot;Base64 encoded: {encoded_binary}&quot;)</pre><h3>Manfaat / Keuntungan</h3><ol><li>Memungkinkan transmisi data biner melalui channel teks</li><li>Standar yang diterima secara universal</li><li>Tidak ada loss data dalam encoding/decoding</li><li>Implementasi sederhana dan efisien</li><li>Kompatibel dengan berbagai sistem dan protokol</li></ol><h3>Kelemahan / Batasan</h3><ol><li>Meningkatkan ukuran data sekitar 33–36%</li><li>Bukan metode enkripsi — tidak memberikan keamanan</li><li>Data dapat dengan mudah di-decode oleh siapa saja</li><li>Overhead processing untuk encoding/decoding data besar</li></ol><h3>Contoh Aplikasi Nyata</h3><p>Base64 digunakan secara luas dalam email attachments, embedded images dalam HTML/CSS (data URIs), JSON Web Tokens (JWT), dan penyimpanan data biner dalam format XML atau JSON.</p><h3>Metode E: Frequency Analysis</h3><h3>Sejarah Singkat</h3><p>Frequency analysis pertama kali didokumentasikan oleh ilmuwan Arab Al-Kindi pada abad ke-9 dalam bukunya “<em>Manuscript on Deciphering Cryptographic Messages</em>”. Metode ini menjadi teknik cryptanalysis paling penting selama berabad-abad dan berperan penting dalam memecahkan berbagai cipher historis termasuk dalam Perang Dunia I dan II.</p><h3>Definisi Singkat</h3><p>Frequency analysis adalah teknik cryptanalysis yang menganalisis frekuensi kemunculan karakter atau kelompok karakter dalam ciphertext untuk mengidentifikasi pola yang dapat membantu memecahkan cipher. Teknik ini memanfaatkan fakta bahwa dalam setiap bahasa, huruf-huruf muncul dengan frekuensi karakteristik tertentu.</p><h3>Cara Kerja / Algoritma</h3><p>Langkah-langkah frequency analysis:</p><ol><li>Hitung frekuensi setiap karakter dalam ciphertext</li><li>Bandingkan dengan frekuensi standar bahasa target</li><li>Buat hipotesis substitusi berdasarkan kecocokan frekuensi</li><li>Uji hipotesis dengan mencari pola kata umum</li><li>Iterasi dan perbaiki mapping hingga plaintext terbaca</li></ol><p>Frekuensi huruf dalam bahasa Inggris (approximate):</p><ul><li>E: 12.8%, T: 9.1%, A: 8.1%, O: 7.5%, I: 7.0%, N: 6.7%, dll.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*pK7PSpGArAIyTWve" /><figcaption><strong>Gambar 13.</strong> <a href="https://plotly.com/~dbz3773/0.embed">Letter Frequency in the English Language</a></figcaption></figure><h3>Contoh Implementasi Python dengan Serangan Praktis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ywaUasZ5sYBXeFnnNnK1uA.png" /><figcaption><strong>Gambar 14. </strong>Generate by Gemini</figcaption></figure><pre>from collections import Counter<br>import string<br><br>def frequency_analysis(text):<br>    &quot;&quot;&quot;Analisis frekuensi karakter dalam text&quot;&quot;&quot;<br>    # Remove non-alphabetic and convert to uppercase<br>    text = &#39;&#39;.join(c.upper() for c in text if c.isalpha())<br>    <br>    # Count frequency<br>    freq_count = Counter(text)<br>    total = len(text)<br>    <br>    # Calculate percentage<br>    freq_percent = {}<br>    for char, count in freq_count.items():<br>        freq_percent[char] = (count / total) * 100<br>    <br>    return freq_percent, freq_count<br><br>def caesar_cryptanalysis(ciphertext):<br>    &quot;&quot;&quot;Break Caesar cipher using frequency analysis&quot;&quot;&quot;<br>    # English letter frequency (approximate)<br>    english_freq = {<br>        &#39;E&#39;: 12.8, &#39;T&#39;: 9.1, &#39;A&#39;: 8.1, &#39;O&#39;: 7.5, &#39;I&#39;: 7.0,<br>        &#39;N&#39;: 6.7, &#39;S&#39;: 6.3, &#39;H&#39;: 6.1, &#39;R&#39;: 6.0, &#39;L&#39;: 4.0<br>    }<br>    <br>    # Get ciphertext frequency<br>    cipher_freq, cipher_count = frequency_analysis(ciphertext)<br>    <br>    # Find most common letter in ciphertext<br>    most_common = max(cipher_count, key=cipher_count.get)<br>    <br>    # Assume it maps to &#39;E&#39; (most common in English)<br>    probable_shift = (ord(most_common) - ord(&#39;E&#39;)) % 26<br>    <br>    print(f&quot;Most common letter in ciphertext: {most_common}&quot;)<br>    print(f&quot;Probable shift (assuming it&#39;s &#39;E&#39;): {probable_shift}&quot;)<br>    <br>    # Try decryption<br>    decrypted = &quot;&quot;<br>    for char in ciphertext:<br>        if char.isalpha():<br>            base = ord(&#39;A&#39;) if char.isupper() else ord(&#39;a&#39;)<br>            decrypted += chr((ord(char) - base - probable_shift) % 26 + base)<br>        else:<br>            decrypted += char<br>    <br>    return decrypted, probable_shift<br><br># Contoh serangan praktis<br>ciphertext = &quot;&quot;&quot;URKAG QZODK BFMPA OGYQZ FFTQD QEGXF IUXXN QETAI ZUZMZ <br>QIEGN IUZPA IFTQF UFXQA RFTQD QEGXF UZSIU ZPAIO AZFMU ZENAF <br>TFTQZ MYQAR FTQAD USUZM XPAOG YQZFM ZPFTQ QZODK BFUAZ WQKGE <br>QPFTQ GEMSQ ARWQK&quot;&quot;&quot;<br><br>print(&quot;=== FREQUENCY ANALYSIS ATTACK ===&quot;)<br>print(f&quot;Ciphertext: {ciphertext[:50]}...&quot;)<br><br># Analyze frequency<br>freq_percent, freq_count = frequency_analysis(ciphertext)<br>print(&quot;\nTop 5 most frequent letters:&quot;)<br>for char, count in sorted(freq_count.items(), key=lambda x: x[1], reverse=True)[:5]:<br>    print(f&quot;  {char}: {count} times ({freq_percent[char]:.1f}%)&quot;)<br><br># Attempt to break<br>decrypted, shift = caesar_cryptanalysis(ciphertext)<br>print(f&quot;\nDecrypted text (shift={shift}):&quot;)<br>print(decrypted[:100])<br><br># Verify by trying all shifts<br>print(&quot;\n=== BRUTE FORCE VERIFICATION ===&quot;)<br>for test_shift in range(26):<br>    test_decrypt = &quot;&quot;<br>    for char in ciphertext[:20]:  # Just first 20 chars<br>        if char.isalpha():<br>            base = ord(&#39;A&#39;)<br>            test_decrypt += chr((ord(char) - base - test_shift) % 26 + base)<br>        else:<br>            test_decrypt += char<br>    if test_shift == shift:<br>        print(f&quot;Shift {test_shift:2}: {test_decrypt} &lt;-- FOUND BY FREQ ANALYSIS&quot;)<br>    else:<br>        print(f&quot;Shift {test_shift:2}: {test_decrypt}&quot;)</pre><h3>Manfaat / Keuntungan</h3><ol><li>Efektif untuk memecahkan cipher substitusi sederhana</li><li>Tidak memerlukan komputasi yang intensif</li><li>Dapat dikombinasikan dengan teknik lain</li><li>Berguna untuk analisis bahasa dan teks</li><li>Dasar untuk teknik cryptanalysis yang lebih kompleks</li></ol><h3>Kelemahan / Batasan</h3><ol><li>Tidak efektif terhadap cipher polyalphabetic modern</li><li>Memerlukan ciphertext yang cukup panjang</li><li>Bergantung pada pengetahuan bahasa target</li><li>Tidak berguna untuk cipher dengan diffusion yang baik</li><li>Gagal pada teks yang tidak mengikuti distribusi normal</li></ol><h3>Contoh Aplikasi Nyata</h3><p>Frequency analysis digunakan dalam forensik digital untuk mengidentifikasi bahasa dokumen terenkripsi, analisis historis untuk memecahkan dokumen kuno, dan sebagai komponen dalam sistem deteksi anomali modern.</p><h3>Kesimpulan</h3><p>Melalui eksplorasi ini, kami telah mempelajari lima metode penting dalam cryptography yang mencakup tiga kategori utama. Dari cipher klasik seperti Caesar dan Vigenère yang menunjukkan evolusi teknik enkripsi, hingga standar modern AES yang mengamankan komunikasi digital saat ini. Base64 menunjukkan perbedaan penting antara encoding dan enkripsi, sementara frequency analysis mengajarkan pentingnya memahami kelemahan sistem untuk membangun yang lebih kuat. Setiap metode memiliki tempat dalam sejarah dan perkembangan cryptography, dari yang paling sederhana hingga yang paling kompleks, menunjukkan bagaimana kebutuhan keamanan informasi telah mendorong inovasi berkelanjutan dalam bidang ini.</p><h3>Penutup</h3><p>Eksplorasi metode cryptography ini memberikan kami pemahaman mendalam tentang evolusi teknik pengamanan informasi dari masa klasik hingga modern. Kami menyadari bahwa keamanan informasi bukan hanya tentang teknologi, tetapi juga tentang memahami prinsip-prinsip matematika dan logika yang mendasarinya. Pembelajaran ini sangat relevan mengingat pentingnya keamanan data dalam era digital saat ini.</p><h3>Daftar Pustaka</h3><ol><li>CrypTool Portal. (2024). <em>CrypTool Online — Cryptography Portal</em>. <a href="https://www.cryptool.org/en/cto/">https://www.cryptool.org/en/cto/</a></li><li>National Institute of Standards and Technology. (2001). <em>Advanced Encryption Standard (AES) — FIPS PUB 197</em>. <a href="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf">https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf</a></li><li>Daemen, J., &amp; Rijmen, V. (2001). <em>The Design of Rijndael: AES — The Advanced Encryption Standard</em>. Springer-Verlag.</li><li>Singh, S. (1999). <em>The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography</em>. Anchor Books.</li><li>Kasiski, F. W. (1863). <em>Die Geheimschriften und die Dechiffrir-Kunst</em>. Berlin: E. S. Mittler und Sohn.</li><li>Analytics Vidhya. (2025). Understanding Base64 Encoding. Diakses pada 14 Oktober 2025, dari <a href="https://www.analyticsvidhya.com/blog/2025/05/base64/">https://www.analyticsvidhya.com/blog/2025/05/base64/</a></li><li>B64Encode. (n.d.). Base64 Algorithm Explained. Diakses pada 14 Oktober 2025, dari <a href="https://b64encode.com/blog/base64-algorithm/">https://b64encode.com/blog/base64-algorithm/</a></li><li>Boxentriq. (n.d.). Caesar Cipher — Code Breaking and Decoding Tool. Diakses pada 14 Oktober 2025, dari <a href="https://www.boxentriq.com/code-breaking/caesar-cipher">https://www.boxentriq.com/code-breaking/caesar-cipher</a></li><li>National Institute of Standards and Technology. (2001). Advanced Encryption Standard (AES) — FIPS PUB 197. <a href="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf">https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf</a></li><li>Plotly. (n.d.). Letter Frequency Chart. Diakses pada 14 Oktober 2025, dari <a href="https://plotly.com/~dbz3773/0.embed">https://plotly.com/~dbz3773/0.embed</a></li><li>Wikipedia. (2024). Caesar cipher. Diakses pada 14 Oktober 2025, dari <a href="https://en.wikipedia.org/wiki/Caesar_cipher">https://en.wikipedia.org/wiki/Caesar_cipher</a></li><li>Wikipedia. (2024). File:AES (Rijndael) Round Function.png. Wikimedia Commons. Diakses pada 14 Oktober 2025, dari <a href="https://en.wikipedia.org/wiki/File:AES_(Rijndael)_Round_Function.png">https://en.wikipedia.org/wiki/File:AES_(Rijndael)_Round_Function.png</a></li><li>wikiHow. (n.d.). How to Encode and Decode Using the Vigenère Cipher. Diakses pada 14 Oktober 2025, dari <a href="https://www.wikihow.com/Encode-and-Decode-Using-the-Vig%C3%A8nere-Cipher">https://www.wikihow.com/Encode-and-Decode-Using-the-Vig%C3%A8nere-Cipher</a></li></ol><p><strong>Metode yang dipilih:</strong> A: AES (Advanced Encryption Standard), B: Caesar Cipher, C: Vigenère Cipher, D: Base64, E: Frequency Analysis</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50d92e30bca0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>