团队作业(五):项目冲刺3
各个成员今日完成的任务
范超明:完善前端代码
周意凯:加密解密代码修改
黄琪凯:完善后端代码
尤其羽:完善后端代码
杨语桐:代码测试
代码完成情况
前端新增部分代码
os.remove("server_password.encrypted")
with open("server_password", 'w') as server_info:
server_info.write(new_password)
encrypt_file("server_password", new_sm4_key)
print("successfullly change server password, restart the server to complete")
后端新增部分代码
def generate_sm4_key(input_string):
# 使用SHA-256哈希算法
hash_obj = hashlib.sha256()
hash_obj.update(input_string.encode()) # 输入字符串转换为字节串
hash_digest = hash_obj.digest() # 生成256位哈希值
# 提取前128位(16字节)作为SM4密钥
sm4_key = hash_digest[:16]
return sm4_key
加密解密部分新增代码
def encrypt_files(directory, sm4_key):
print("encrypting all the files, waiting...")
for filename in os.listdir(directory):
file_path = os.path.join(directory, filename)
# 检查文件是否已经加密
if not filename.endswith('.encrypted'):
# 执行加密操作
encrypt_file(file_path, sm4_key)
print("encrypt all the files successfully")
提交到gitee
明日各个成员的任务安排
范超明:继续完善前端代码
周意凯:继续加密解密代码修改
黄琪凯:继续完善后端代码
尤其羽:继续完善后端代码
杨语桐:代码测试
各个成员今日对项目的贡献量
姓 名 | 贡献量 |
---|---|
范超明 | 2 |
周意凯 | 2 |
黄琪凯 | 2 |
尤其羽 | 2 |
杨语桐 | 2 |