Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dms-codes/kriptografi-substitution
Simple Substitution Cipher This Python script demonstrates a simple substitution cipher. It allows you to encrypt and decrypt text using a custom cipher alphabet.
https://github.com/dms-codes/kriptografi-substitution
python substitution-cipher
Last synced: 2 days ago
JSON representation
Simple Substitution Cipher This Python script demonstrates a simple substitution cipher. It allows you to encrypt and decrypt text using a custom cipher alphabet.
- Host: GitHub
- URL: https://github.com/dms-codes/kriptografi-substitution
- Owner: dms-codes
- Created: 2022-11-15T14:26:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-01T07:46:19.000Z (over 1 year ago)
- Last Synced: 2023-10-01T08:31:55.384Z (over 1 year ago)
- Topics: python, substitution-cipher
- Language: Python
- Homepage: https://github.com/dms-codes/kriptografi-substitution
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Substitution Cipher
This Python script demonstrates a simple substitution cipher. It allows you to encrypt and decrypt text using a custom cipher alphabet.
## Overview
A substitution cipher is a method of encrypting plaintext by replacing each letter with another letter. In this script, you can specify a custom cipher alphabet to perform both encryption and decryption.
- The `plaintext` variable contains the text that you want to encrypt.
- The `cipheralphabet` variable contains the custom substitution alphabet.
- The `plainalphabet` variable contains the standard uppercase alphabet.The script provides two main functions:
- `encrypt(plaintext, cipheralphabet)`: Encrypts the input `plaintext` using the specified `cipheralphabet` and returns the ciphertext.
- `decrypt(ciphertext, cipheralphabet)`: Decrypts the input `ciphertext` using the specified `cipheralphabet` and returns the original plaintext.## Usage
1. Customize the `plaintext` and `cipheralphabet` variables in the script to set your desired input text and custom substitution alphabet.
2. Run the script by executing the following command in your terminal:
```bash
python your_script_name.py
```3. The script will perform the encryption and decryption using the specified inputs and print the results.
4. You can modify the `plaintext` and `cipheralphabet` variables in the script to test different inputs and substitution alphabets.
## Example
Suppose you have configured the script with the following settings:
- `plaintext = 'SELAMAT DATANG DI KELAS KRIPTOGRAFI'`
- `cipheralphabet = 'QAMOCDBHRUWLKJNVTZFISPEGYX'`After running the script, you will see the ciphertext and the decrypted plaintext as output.
## Security Note
This is a simple example of a substitution cipher and should not be used for secure encryption. In practice, more complex encryption algorithms and key management are required for secure communication.
## License
This script is provided under the [MIT License](LICENSE).
```Replace `"your_script_name.py"` with the actual name of your script. Customize the README.md file further if needed to include additional information or usage examples for your project.