https://github.com/codewithswastik/dcoder
This is the source code of "dcoder" which a python module that can decode/encode text in various ciphers.
https://github.com/codewithswastik/dcoder
Last synced: 11 months ago
JSON representation
This is the source code of "dcoder" which a python module that can decode/encode text in various ciphers.
- Host: GitHub
- URL: https://github.com/codewithswastik/dcoder
- Owner: CodeWithSwastik
- License: mit
- Created: 2021-01-23T07:17:25.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-24T02:58:47.000Z (almost 5 years ago)
- Last Synced: 2024-10-14T08:45:35.676Z (over 1 year ago)
- Language: Python
- Size: 2.69 MB
- Stars: 21
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dcoder 0.2.1
[](https://pepy.tech/project/dcoder)
dcoder is a python module that provides various functions for decoding/encoding text. It also has functions for encrypting or decrypting text in various ciphers.
PyPI: https://pypi.org/project/dcoder/
Docs: https://dcoder.readthedocs.io/en/latest/
## Installation
You can install released versions of dcoder from the Python Package Index with pip or a similar tool:
**Stable Release:** `pip install dcoder`
**Working Version:** `pip install git+https://github.com/CodeWithSwastik/dcoder.git`
## Usage:
```python
>>> import dcoder
>>> dcoder.text2hex("Hello!") #Encodes the string and returns the hex string
'48 65 6c 6c 6f 21'
>>> dcoder.hex2text("48 69 20 74 68 65 72 65 21") #Decodes the hex string and returns the plain text
'Hi there!'
>>> dcoder.text2caesar("How are you?") #Encrypts the text in caesar's cipher and returns it
'Krz duh brx?'
>>> dcoder.caesar2text("L dp ilqh, wkdqn brx.") #Decrypts the cipher text and returns the decrypted text
'I am fine, thank you.'
```
## Functions available:
The current list of functions available are:
Encoding:
```python
text2bin(text)
text2oct(text)
text2hex(text)
text2ascii(text)
```
Decoding:
```python
bin2text(binary_text)
oct2text(oct_text)
hex2text(hex_text)
ascii2text(ascii_text)
```
Encryption:
```python
text2atbash(text)
text2caesar(text, shift = 3)
text2railfence(text, key = 3)
```
Decryption:
```python
atbash2text(encrypted_text)
caesar2text(encrypted_text, shift = 3)
caesarBruteforce(encrypted_text)
railfence2text(cipher, key = 3)
railfenceBruteforce(encrypted_text)
```
Misc:
```python
reverse(text)
capitalLetterCipher(ciphertext)
firstLetterCipher(ciphertext)
```