FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Basic-Programs-Python/Programs/python_encryption.py at master · Akshu-on-github/Basic-Programs-Python · GitHub
This repository was archived by the owner on Jan 30, 2023. It is now read-only.
Akshu-on-github
/
Basic-Programs-Python
Public archive
Notifications
You must be signed in to change notification settings
Fork
23
Star
13
Code
Issues
0
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Basic-Programs-Python
/
Programs
/
python_encryption.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (38 loc) · 1.25 KB
Breadcrumbs
Basic-Programs-Python
/
Programs
/
python_encryption.py
Copy path
File metadata and controls
40 lines (38 loc) · 1.25 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import
base64
print
(
"Python Base64 Program"
)
print
(
"===== Choose tools ======"
)
print
(
"1. Base64 "
)
print
(
"2. Base16 "
)
print
(
"3. Coming soon .... "
)
print
(
"========================="
)
userInput
=
input
(
"Choose number: "
)
if
(
userInput
==
"1"
):
print
(
"=================="
)
print
(
"1. Encode"
)
print
(
"2. Decode"
)
print
(
"=================="
)
userInput
=
input
(
"Choose number: "
)
if
(
userInput
==
"1"
):
text
=
input
(
"Input text you want to encode: "
)
b64text
=
base64
.
b64encode
(
text
.
encode
(
"utf-8"
))
b64text
=
str
(
b64text
,
"utf-8"
)
print
(
"Encoded text: "
+
b64text
)
if
(
userInput
==
"2"
):
text
=
input
(
"Input base64 you want to decode: "
)
plain
=
base64
.
b64decode
(
text
)
print
(
"Decoded text: "
+
str
(
plain
,
"utf-8"
))
elif
(
userInput
==
"2"
):
print
(
"=================="
)
print
(
"1. Encode"
)
print
(
"2. Decode"
)
print
(
"=================="
)
userInput
=
input
(
"Choose number: "
)
if
(
userInput
==
"1"
):
text
=
input
(
"Input text you want to encode: "
)
b16text
=
base64
.
b16encode
(
text
.
encode
(
"utf-8"
))
b16text
=
str
(
b16text
,
"utf-8"
)
print
(
"Encoded text: "
+
b16text
)
if
(
userInput
==
"2"
):
text
=
input
(
"Input base16 you want to decode: "
)
plain
=
base64
.
b16decode
(
text
)
print
(
"Decoded text: "
+
str
(
plain
,
"utf-8"
))
Back
|
FazBrowse Home
|
New Git URL