Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db8fc22

Browse filesBrowse files
committed
improve readme documentation
1 parent c2a2e3c commit db8fc22
Copy full SHA for db8fc22

File tree

2 files changed

+82
-0
lines changed
Filter options

2 files changed

+82
-0
lines changed

‎README.md

Copy file name to clipboard
+70Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,72 @@
11
# ascii-encryption-python
22
Beginner guide to ascii based encryption implemented in Python
3+
4+
Getting started
5+
----------------
6+
This is just a simple encryption algorithms that can be cool when it comes to understanding and exploring how does encryption works, but not seriously used to handle security on real life circumstances
7+
8+
To get started with repo you might have to clone or download the repository just as shown below;
9+
10+
```bash
11+
12+
git clone https://github.com/Kalebu/ascii-encryption-python
13+
14+
```
15+
16+
Basics
17+
----------------
18+
If you're new to ascii encryption, this simple involving converting the alphabetics to their ascii numerical value and using a secret number to add or substract from their real value and then turning back into characters as encrypted one.
19+
20+
For instance
21+
22+
```bash
23+
24+
Encrypting
25+
26+
a - > 97 -> 97 (+|-) secret_number -> new characer
27+
28+
Lets say our secret number is 5
29+
30+
a -> 97 -> 97 + 5 -> f
31+
32+
Decrypting
33+
34+
To descrypt we need to know the secret number otherwise we wont be able to do it so
35+
36+
f -> 102 -> 102 (+|-) secret number -> decrypted character
37+
38+
Since we know the serect number is 5
39+
40+
f -> 102 -> 102 - 5 > a
41+
42+
```
43+
44+
In this repository I have implemented two simple function just do that, which take a textual input of any size and then encrypt it using ascii value based on your secret number and then it will return back encrypted text.
45+
46+
Samewise to decryption, you are going to specify the secret number and then it will recieve your encrypted text input and then render to you decrypted text output
47+
48+
49+
Demo
50+
------------
51+
52+
```python
53+
>>> from algorithms import encrypt , decrypt
54+
>>> army_text = "Throw the missiles at 9pm"
55+
>>> encrypt(army_text, key=10)
56+
'^r|y\x81*~ro*ws}}svo}*k~*Czw'
57+
>>> decrypt('^r|y\x81*~ro*ws}}svo}*k~*Czw', key=10)
58+
'Throw the missiles at 9pm'
59+
```
60+
61+
Explore it
62+
-----------
63+
Now keep explore it by testing it with various input links to see what links it will scrap
64+
65+
Give it a star
66+
--------------
67+
Did you find this information useful, then give it a star
68+
69+
70+
Credits
71+
-----------
72+
All the credits to [kalebu](github.com/kalebu)

‎app.py renamed to ‎algorithms.py

Copy file name to clipboardExpand all lines: algorithms.py
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# ===============================================================
2+
# ============ FUNCTION TO DO ASCII BASED ENCRYPTION ===========
3+
# ============ BASED ON A CERTAIN KEY ===========
4+
# ================================================================
5+
6+
17
def encrypt(text, key=0):
28
if not isinstance(text, str):
39
raise TypeError("{} should be a type string".format(text))
@@ -6,6 +12,12 @@ def encrypt(text, key=0):
612
return "".join([chr(ord(something) + key) for something in text])
713

814

15+
# ===================================================================
16+
# ============= FUNCTION TO DO ASCII BASED DECRYPTION ===============
17+
# ============= BASED ON A CERTAIN KEY ===============
18+
# ===================================================================
19+
20+
921
def decrypt(text, key=0):
1022
if not isinstance(text, str):
1123
raise TypeError("{} should be a type string".format(text))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.