mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-14 06:52:59 +08:00
Compare commits
8 Commits
e6e19d55c9
...
a30a61b01e
Author | SHA1 | Date | |
---|---|---|---|
|
a30a61b01e | ||
|
74377959c0 | ||
|
7844a35ad0 | ||
|
a81e668be8 | ||
|
7b824eba65 | ||
|
d8a7e1f748 | ||
|
2fb88ea333 | ||
|
5057069ac7 |
34
src/algorithms/cryptography/caesar-cipher/README.id-ID.md
Normal file
34
src/algorithms/cryptography/caesar-cipher/README.id-ID.md
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# Algoritma Caesar Cipher
|
||||||
|
|
||||||
|
_Baca ini dalam bahasa lain:_
|
||||||
|
[_Русский_](README.ru-RU.md)
|
||||||
|
[_English_](README.md)
|
||||||
|
|
||||||
|
Dalam kriptografi, **Sandi Caesar**, juga dikenal sebagai **Sandi Caesar**, **Sandi Geser**, **Kode Caesar** atau **Pergeseran Caesar**, adalah salah satu teknik enkripsi yang paling sederhana dan paling dikenal. Ini adalah jenis cipher substitusi di mana setiap huruf dalam plaintext diganti dengan huruf beberapa posisi tetap di bawah alfabet. Sebagai contoh, dengan pergeseran kiri `3`, `D` akan digantikan oleh `A`, `E` akan menjadi `B`, dan seterusnya. Metode ini dinamai Julius Caesar, yang menggunakannya dalam korespondensi pribadinya.
|
||||||
|
|
||||||
|
![Algoritma Caesar Cipher](https://upload.wikimedia.org/wikipedia/commons/4/4a/Caesar_cipher_left_shift_of_3.svg)
|
||||||
|
|
||||||
|
## Contoh
|
||||||
|
|
||||||
|
Transformasi dapat diwakili dengan menyelaraskan dua huruf; alfabet "chiper" adalah alfabet "plain" yang diputar ke kiri atau kanan oleh sejumlah posisi. Misalnya, berikut adalah sandi Caesar menggunakan rotasi kiri tiga tempat, setara dengan pergeseran kanan 23 (parameter pergeseran digunakan sebagai kunci):
|
||||||
|
|
||||||
|
```teks
|
||||||
|
Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||||
|
Chiper: XYZABCDEFGHIJKLMNOPQRSTUVW
|
||||||
|
```
|
||||||
|
|
||||||
|
Saat mengenkripsi, seseorang mencari setiap huruf pesan di baris "plain" dan menuliskan huruf yang sesuai di baris "chiper".
|
||||||
|
|
||||||
|
```teks
|
||||||
|
Plaintext: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
|
||||||
|
Ciphertext: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
|
||||||
|
```
|
||||||
|
|
||||||
|
## Kompleksitas
|
||||||
|
|
||||||
|
- Waktu: `O(|n|)`
|
||||||
|
- Ruang: `O(|n|)`
|
||||||
|
|
||||||
|
## Referensi
|
||||||
|
|
||||||
|
- [Caesar cipher di Wikipedia](https://id.wikipedia.org/wiki/Sandi_Caesar)
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
_Read this in other languages:_
|
_Read this in other languages:_
|
||||||
[_Русский_](README.ru-RU.md)
|
[_Русский_](README.ru-RU.md)
|
||||||
|
[Bahasa Indonesia](README.id-ID.md)
|
||||||
|
|
||||||
In cryptography, a **Caesar cipher**, also known as **Caesar's cipher**, the **shift cipher**, **Caesar's code** or **Caesar shift**, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of `3`, `D` would be replaced by `A`, `E` would become `B`, and so on. The method is named after Julius Caesar, who used it in his private correspondence.
|
In cryptography, a **Caesar cipher**, also known as **Caesar's cipher**, the **shift cipher**, **Caesar's code** or **Caesar shift**, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of `3`, `D` would be replaced by `A`, `E` would become `B`, and so on. The method is named after Julius Caesar, who used it in his private correspondence.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user