{"id":16269614,"url":"https://github.com/hiyouga/cryptography-experiment","last_synced_at":"2025-10-24T12:57:49.338Z","repository":{"id":111024914,"uuid":"187971763","full_name":"hiyouga/cryptography-experiment","owner":"hiyouga","description":"BUAA CST Spring 2019 Cryptography Experiment","archived":false,"fork":false,"pushed_at":"2019-11-23T09:13:35.000Z","size":6409,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-29T13:32:17.554Z","etag":null,"topics":["aes-128","crypto","cryptography","data-encryption-standard","dsa","ecc","hash","rsa-cryptography","sm2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hiyouga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-22T05:54:22.000Z","updated_at":"2024-07-02T03:58:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d0ba5cf-5058-47cf-a1e6-fd0c4f10d3aa","html_url":"https://github.com/hiyouga/cryptography-experiment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiyouga%2Fcryptography-experiment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiyouga%2Fcryptography-experiment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiyouga%2Fcryptography-experiment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiyouga%2Fcryptography-experiment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hiyouga","download_url":"https://codeload.github.com/hiyouga/cryptography-experiment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232581233,"owners_count":18545420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aes-128","crypto","cryptography","data-encryption-standard","dsa","ecc","hash","rsa-cryptography","sm2"],"created_at":"2024-10-10T18:08:41.404Z","updated_at":"2025-10-24T12:57:44.280Z","avatar_url":"https://github.com/hiyouga.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cryptography-experiment\n\nBUAA-CST Spring 2019 Cryptography Experiment Project Code (Python).\n\n[![LICENSE](https://img.shields.io/packagist/l/doctrine/orm.svg)](LICENSE)\n\n## Requirement\n\n- Python 3\n- multiprocessing\n- numpy [optional]\n- matplotlib [optional]\n\n## Contents\n\n- [utils/](MyCrypto/utils/) - Some useful utilities in cryptography.\n  - [bigInt.cpp](MyCrypto/utils/bigInt.cpp) - Big integer arithmetic in C++. [[ref]](https://github.com/faheel/BigInt)\n  - [bitarray.py](MyCrypto/utils/bitarray.py) - A bit array class.\n  - [matrix.py](MyCrypto/utils/matrix.py) - Arithmetic of matrices.\n  - [residue_field.py](MyCrypto/utils/residue_field.py) - Residue field `Z_p`.\n  - [extension_field.py](MyCrypto/utils/extension_field.py) - Galois Field `GF[x]/(p(x))`.\n  - [galois_field.py](MyCrypto/utils/galois_field.py) - Galois Field `GF_2^m`.\n- [algorithms/](MyCrypto/algorithms/) - Basic algorithms in cryptography.\n  - [prime_sieve.py](MyCrypto/algorithms/prime_sieve.py) - Generate primes with Sieve of Eratosthenes.\n  - [exgcd.py](MyCrypto/algorithms/exgcd.py) -  Extended Euclidean algorithm.\n  - [power.py](MyCrypto/algorithms/power.py) - Modular exponentiation algorithm.\n  - [crt.py](MyCrypto/algorithms/crt.py) - Chinese Remainder Theorem (CRT).\n  - [prime_test.py](MyCrypto/algorithms/prime_test.py) - Probabilistic primality testing. (Miller–Rabin/Fermat/Solovay–Strassen)\n  - [prime_root.py](MyCrypto/algorithms/prime_root.py) - Generate prime roots in `Z_p`.\n  - [prime_poly.py](MyCrypto/algorithms/prime_poly.py) - Generate prime polynomial in `GF_2^m`.\n  - [jacobi.py](MyCrypto/algorithms/jacobi.py) - Calculate the Jacobi symbol.\n- [classical/](MyCrypto/classical/) - Classical Cryptography.\n  - [affine.py](MyCrypto/classical/affine.py) - Affine Cipher.\n  - [vigenere.py](MyCrypto/classical/vigenere.py) - Vigenere Cipher.\n  - [vernam.py](MyCrypto/classical/vernam.py) - Vernam Cipher.\n  - [crack_single_table.py](MyCrypto/classical/crack_single_table.py) - Crack simple substitution cipher using letter frequency analysis.\n  - [hill.py](MyCrypto/classical/hill.py) - Hill cipher and the cracker.\n- [des/](MyCrypto/des/) - Data Encryption Standard (DES).\n  - [des_utils.py](MyCrypto/des/des_utils.py) - Some utilities in DES.\n  - [des.py](MyCrypto/des/des.py) - A 64-bit DES block cipher.\n  - [diff_crypt.py](MyCrypto/des/diff_crypt.py) - Use differential cryptanalysis to attack DES cipher.\n  - [triple_des.py](MyCrypto/des/triple_des.py) - A 3-DES block cipher.\n  - [s_des.py](MyCrypto/des/s_des.py) - A simplified DES cipher.\n  - [mitm.py](MyCrypto/des/mitm.py) - Use meet-in-the-middle attack on double S-DES.\n- [aes/](MyCrypto/aes/) - Advanced Encryption Standard (AES).\n  - [aes.py](MyCrypto/aes/aes.py) - A 128-bit AES block cipher.\n  - [fast_aes.py](MyCrypto/aes/fast_aes.py) - A look-up-table implementation of AES to accelerate the algorithm.\n  - [block_cipher.py](MyCrypto/aes/block_cipher.py) - Some block cipher modes of operation. (ECB/CBC/CFB)\n  - [cipher_gui.py](MyCrypto/aes/cipher_gui.py) - A simple GUI for our block cipher.\n- [rsa/](MyCrypto/rsa/) - Rivest-Shamir-Adleman (RSA) cryptosystem.\n  - [knapsack_cipher.py](MyCrypto/rsa/knapsack_cipher.py) - A public-key cryptosystem based on knapsack problem.\n  - [rsa.py](MyCrypto/rsa/rsa.py) - A 1024-bit RSA public-key cryptosystem.\n  - [rsa_oaep.py](MyCrypto/rsa/rsa_oaep.py) - RSA with Optimal Asymmetric Encryption Padding (OAEP).\n- [ecc/](MyCrypto/ecc/) - Elliptic-curve cryptography (ECC).\n  - [ecc.py](MyCrypto/ecc/ecc.py) - The basic elliptic curve arithmetic.\n  - [diffie_hellman_ecc.py](MyCrypto/ecc/diffie_hellman_ecc.py) - The anonymous key agreement protocol over elliptic curves. (Also ECDH)\n  - [elgamal_ecc.py](MyCrypto/ecc/elgamal_ecc.py) - The ElGamal public-key cryptosystem over elliptic curves.\n  - [sm2.py](MyCrypto/ecc/sm2.py) - The SM2 ([GM/T 0003-2012](http://www.gmbz.org.cn/main/bzlb.html)) public-key cryptography standard.\n- [hash/](MyCrypto/hash/) - Cryptographic hash functions.\n  - [sha_utils.py](MyCrypto/hash/sha_utils.py) - Some utilities for Secure Hash Algorithm (SHA) family.\n  - [sha1.py](MyCrypto/hash/sha1.py) - The SHA-1 (Secure Hash Algorithm 1) hash function.\n  - [sha3.py](MyCrypto/hash/sha3.py) - The SHA-3 (Secure Hash Algorithm 3) hash function. (Also Keccak) \n  - [hmac.py](MyCrypto/hash/hmac.py) - A HMAC (Hash-based Message Authentication Code) function with SHA.\n  - [birthday_attack.py](MyCrypto/hash/birthday_attack.py) - A birthday attack example on SHA3-16.\n  - [message_variants.py](MyCrypto/hash/message_variants.py) - Generate arbitrary number of message variants.\n- [dsa/](MyCrypto/dsa/) - Digital signature algorithms.\n  - [dsa.py](MyCrypto/dsa/dsa.py) - The NIST proposed DSA in Digital Signature Standard (DSS).\n  - [elgamal_dsa.py](MyCrypto/dsa/elgamal_dsa.py) - The ElGamal signature scheme based on DLP.\n  - [schnorr_dsa.py](MyCrypto/dsa/schnorr_dsa.py) - The Schnorr signature scheme based on DLP.\n  - [sm2_dsa.py](MyCrypto/dsa/sm2_dsa.py) - The SM2 ([GM/T 0003-2012](http://www.gmbz.org.cn/main/bzlb.html)) digital signature algorithm based on ECC.\n- [testdata/](MyCrypto/testdata/) - Test data folder.\n  - [text.txt](MyCrypto/testdata/text.txt) - A UTF-8 encoded text file contains short Chinese and English sentences.\n\n## Documents\n\n**Simplified Chinese Only!!!**\n\n- [ex1.pdf](Documents/zh-cn/ex1.pdf)\n  - [prime_sieve.py](MyCrypto/algorithms/prime_sieve.py)\n  - [exgcd.py](MyCrypto/algorithms/exgcd.py)\n  - [power.py](MyCrypto/algorithms/power.py)\n  - [crt.py](MyCrypto/algorithms/crt.py)\n- [ex2.pdf](Documents/zh-cn/ex2.pdf)\n  - [prime_test.py](MyCrypto/algorithms/prime_test.py)\n  - [galois_field.py](MyCrypto/utils/galois_field.py)\n  - [prime_root.py](MyCrypto/algorithms/prime_root.py)\n  - [prime_poly.py](MyCrypto/algorithms/prime_poly.py)\n- [ex3.pdf](Documents/zh-cn/ex3.pdf)\n  - [classical](MyCrypto/classical/)\n- [ex4.pdf](Documents/zh-cn/ex4.pdf)\n  - [des](MyCrypto/des/)\n- [ex5.pdf](Documents/zh-cn/ex5.pdf)\n  - [aes.py](MyCrypto/aes/aes.py)\n  - [block_cipher.py](MyCrypto/aes/block_cipher.py)\n  - [cipher_gui.py](MyCrypto/aes/cipher_gui.py)\n- [ex6.pdf](Documents/zh-cn/ex6.pdf)\n  - [fast_aes.py](MyCrypto/aes/fast_aes.py)\n- [ex7.pdf](Documents/zh-cn/ex7.pdf)\n  - [bigInt.cpp](MyCrypto/utils/bigInt.cpp)\n  - [rsa](MyCrypto/rsa/)\n- [ex8.pdf](Documents/zh-cn/ex8.pdf)\n  - [ecc](MyCrypto/ecc/)\n- [ex9.pdf](Documents/zh-cn/ex9.pdf)\n  - [hash](MyCrypto/hash/)\n- [ex10.pdf](Documents/zh-cn/ex10.pdf)\n  - [dsa](MyCrypto/dsa/)\n\n## License\n\nThis project is licensed under the terms of the [MIT license](LICENSE).\n\n----\n\n**Don't copy, learn.**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiyouga%2Fcryptography-experiment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiyouga%2Fcryptography-experiment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiyouga%2Fcryptography-experiment/lists"}