Instructions
Objective
Write a python assignment program to create a stamp selling system.
Requirements and Specifications
Source Code
STUDENT_ID = 28211718
def encrypt(plain):
key = STUDENT_ID % 128
encrypted = ''
for c in plain:
encrypted += chr(ord(c) + key)
return encrypted
def decrypt(data):
key = STUDENT_ID % 128
decrypted = ''
for c in data:
decrypted += chr(ord(c) - key)
return decrypted
def get_users():
filename = 'user_details.txt'
try:
f = open(filename, 'r')
return f.read().splitlines()
except:
return []
def login(user, password):
return encrypt(user + ':' + password) in get_users()
print(login('user', '1234'))
Similar Samples
Explore our diverse range of programming homework samples at ProgrammingHomeworkHelp.com. Our carefully curated examples showcase expertise across various languages and topics, demonstrating our commitment to delivering high-quality solutions tailored to your academic requirements. See firsthand how we can assist you in mastering programming concepts effectively through our sample assignments.
Python
Python
Python
Python
Python
Python
Python
Python
Python
Python
Python
Python
Python
Python
Python
Python
Python
Python
Python
Python