Initialize encryption and JavaScript reverse-engineering study repository

Document the project structure and setup while excluding local dependencies and IDE settings.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 23:25:05 +08:00
commit 418a0411d1
34 changed files with 1544 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import base64
from Crypto.Cipher import DES
from Crypto.Util.Padding import pad, unpad
def des_encrypt(plain_text):
cipher = DES.new(des_key, DES.MODE_CBC, iv)
encrypted = cipher.encrypt(pad(plain_text.encode("utf-8"), DES.block_size))
return base64.b64encode(encrypted)
def des_decrypt(cipher_text):
cipher = DES.new(des_key, DES.MODE_CBC, iv)
decrypt_byte_data = base64.b64decode(cipher_text)
decrypted = unpad(cipher.decrypt(decrypt_byte_data), DES.block_size)
return decrypted.decode("utf-8")
source_data = "你好,世界!"
des_key = "12345678".encode("utf-8")
iv = "12345678".encode("utf-8")
if __name__ == "__main__":
enc_data = des_encrypt(source_data)
print(enc_data)
print(des_decrypt(des_encrypt(source_data)))