Skip to content

Latest commit

 

History

History
251 lines (248 loc) · 9.64 KB

File metadata and controls

251 lines (248 loc) · 9.64 KB
<title>Title of the document</title> <style> .modal { display: none; position: fixed; z-index: 8; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0.4); } p { color: black; } .modal-content { margin: 50px auto; border: 1px solid #999; width: 60%; } h2, p { margin: 0 0 20px; font-weight: 400; color: black; } span { color: #9E79AB; display: block; padding: 0 0 5px; } form { padding: 25px; margin: 25px; box-shadow: 0 2px 5px #f5f5f5; background: #eee; } input, textarea { width: 90%; padding: 10px; margin-bottom: 20px; border: 1px solid #1c87c9; outline: none; } .contact-form button { width: 100%; padding: 10px; border: none; background: #1c87c9; font-size: 16px; font-weight: 400; color: #fff; } button:hover { background: #2371a0; } .close { color: #aaa; float: right; font-size: 28px; font-weight: bold; } .close:hover, .close:focus { color: black; text-decoration: none; cursor: pointer; } button.button { background: none; border-top: none; outline: none; border-right: none; border-left: none; border-bottom: #02274a 1px solid; padding: 0 0 3px 0; font-size: 16px; cursor: pointer; } button.button:hover { border-bottom: #a99567 1px solid; color: #a99567; } </style>

How to Encrypt Atbash

How to Decrypt Atbash

Atbash Sample Problem

×

How to Encrypt Atbash

The Atbash Cipher simply reverses the plaintext alphabet to create the ciphertext alphabet. That is, the first letter of the alphabet is encrypted to the last letter of the alphabet, the second letter to the penultimate letter and so forth. In the original Hebrew this means that 'aleph' is encrypted to 'tav', and 'beth' to 'shin'. This is where we get the name of the cipher 'atbash'. For the Hebrew alphabet we get the following conversion table.

Flowers in Chania

For the Roman alphabet of 26 letters, we have the ciphertext alphabet as given in the table below.

Flowers in Chania

As with any monoalphabetic substitution cipher, encryption using the Atbash Cipher is very simple once the ciphertext alphabet has been generated. We simply replace each occurence of each plaintext letter with the respective ciphertext letter given by the table. So, if we take the plaintext "atbash", we can see that "a" enciphers to "Z", "t" enciphers to "G" and so on. Continuing in this way, we see that the final ciphertext is "ZGYZHS".

×

How to Decrypt Atbash

Due to the symmetric nature of this cipher, the decryption process is exactly the same as the encryption process. Thus, for the recipient to decrypt the ciphertext, the same ciphertext alphabet must be generated as was used to encrypt the message in the first place. In this case, the ciphertext alphabet relies only on the alphabet used, and hence the table above is also used to decipher the message. So, given the ciphertext "XRKSVI", and assuming that the alphabet used was the standard Roman alphabet of 26 letters, we can retrieve the plaintext "cipher".

×

Atbash Sample Problem

Encrypt the sample text FLEE AT ONCE!


Choose the best answer:



. UOVV ZG LMXV

. UODD ZG LMXD

. USVV ZG LMSV

. WOVV ZG LMXV

Submit

Decrypt something with Atbash Cipher! <script> let modalBtns = [...document.querySelectorAll(".button")]; modalBtns.forEach(function (btn) { btn.onclick = function () { let modal = btn.getAttribute("data-modal"); document.getElementById(modal).style.display = "block"; }; }); let closeBtns = [...document.querySelectorAll(".close")]; closeBtns.forEach(function (btn) { btn.onclick = function () { let modal = btn.closest(".modal"); modal.style.display = "none"; }; }); window.onclick = function (event) { if (event.target.className === "modal") { event.target.style.display = "none"; } }; // The function evaluates the answer and displays result function displayAnswer1() { if (document.getElementById('option-11').checked) { document.getElementById('block-11').style.border = '3px solid limegreen' document.getElementById('result-11').style.color = 'limegreen' document.getElementById('result-11').innerHTML = 'Correct!' incrementCount() } if (document.getElementById('option-12').checked) { document.getElementById('block-12').style.border = '3px solid red' document.getElementById('result-12').style.color = 'red' document.getElementById('result-12').innerHTML = 'Incorrect!' showCorrectAnswer1() } if (document.getElementById('option-13').checked) { document.getElementById('block-13').style.border = '3px solid red' document.getElementById('result-13').style.color = 'red' document.getElementById('result-13').innerHTML = 'Incorrect!' showCorrectAnswer1() } if (document.getElementById('option-14').checked) { document.getElementById('block-14').style.border = '3px solid red' document.getElementById('result-14').style.color = 'red' document.getElementById('result-14').innerHTML = 'Incorrect!' showCorrectAnswer1() } } // the functon displays the link to the correct answer function showCorrectAnswer1() { let showAnswer1 = document.createElement('p') showAnswer1.innerHTML = 'Show Correct Answer' showAnswer1.style.position = 'relative' showAnswer1.style.top = '-180px' showAnswer1.style.fontSize = '1.75rem' document.getElementById('showanswer1').appendChild(showAnswer1) showAnswer1.addEventListener('click', () => { document.getElementById('block-11').style.border = '3px solid limegreen' document.getElementById('result-11').style.color = 'limegreen' document.getElementById('result-11').innerHTML = 'Correct!' document.getElementById('showanswer1').removeChild(showAnswer1) }) } </script>