๐ป Student Developer | Learning to build smart systems & appealing projects๐ Passionate about exploring the digital world and creating systems that combine logic and creativity.
๐ฏ Aspiring to become a Professor in Computer Science one day.
๐งฉ Iโm currently learning Python, C++, and Web Development while working on small projects.
โก Fun Fact: I am an Analytical Thinker.
๐ง Artificial Intelligence
๐ Web Design & Development
โ๏ธ Building Custom Operating Systems
๐ฎ Game Development
|
|
|
|
|
|
A simple encryption script that shifts ASCII characters and converts them into binary for fun experimentation.
import os
def bintodec(n):
decimal=0
power=0
while n>0:
digit=n%10
if digit==1 or digit==0:
decimal+=digit*(2**power)
n=n//10
power+=1
return decimal
def tb_en(text):
char=[]
decimal=[]
for c in text:
char.append(c)
decimal.append(ord(c))
binlist=[]
for val in decimal:
hold_c=(val+10)%128
binary=format(hold_c,'08b')
binlist.append(binary)
chrt=''
chrt_list=[]
for i in range(len(char)):
bin_str=binlist[i]
bin_dec=bintodec(int(bin_str))
if 0 <=bin_dec<= 128:
ascii_chrt=chr(bin_dec)
chrt_list.append(ascii_chrt)
chrt+=ascii_chrt
for c in range(len(char)):
display=print(" ",char[c]," | ",binlist[c],"| ",chrt_list[c])
print()
print("Encrypted values : ",chrt)
print()
line=input("Enter Text : ")
print()
print(" Char | shift_bin | shift_Char ")
print("------|-----------|------------")
tb_en(line)
os.system('pause')
This project deepened my understanding of binary, ASCII, and modular arithmetic in Python โ turning logic into creativity through code.
๐จโ๐ป Credit: Sineth Suriyapperuma
๐ Last Edited on: 08/11/2025
