BUAA-CST Spring 2019 Cryptography Experiment Project Code (Python).
- Python 3
 - multiprocessing
 - numpy [optional]
 - matplotlib [optional]
 
- utils/ - Some useful utilities in cryptography.
- bigInt.cpp - Big integer arithmetic in C++. [ref]
 - bitarray.py - A bit array class.
 - matrix.py - Arithmetic of matrices.
 - residue_field.py - Residue field 
Z_p. - extension_field.py - Galois Field 
GF[x]/(p(x)). - galois_field.py - Galois Field 
GF_2^m. 
 - algorithms/ - Basic algorithms in cryptography.
- prime_sieve.py - Generate primes with Sieve of Eratosthenes.
 - exgcd.py - Extended Euclidean algorithm.
 - power.py - Modular exponentiation algorithm.
 - crt.py - Chinese Remainder Theorem (CRT).
 - prime_test.py - Probabilistic primality testing. (Miller–Rabin/Fermat/Solovay–Strassen)
 - prime_root.py - Generate prime roots in 
Z_p. - prime_poly.py - Generate prime polynomial in 
GF_2^m. - jacobi.py - Calculate the Jacobi symbol.
 
 - classical/ - Classical Cryptography.
- affine.py - Affine Cipher.
 - vigenere.py - Vigenere Cipher.
 - vernam.py - Vernam Cipher.
 - crack_single_table.py - Crack simple substitution cipher using letter frequency analysis.
 - hill.py - Hill cipher and the cracker.
 
 - des/ - Data Encryption Standard (DES).
- des_utils.py - Some utilities in DES.
 - des.py - A 64-bit DES block cipher.
 - diff_crypt.py - Use differential cryptanalysis to attack DES cipher.
 - triple_des.py - A 3-DES block cipher.
 - s_des.py - A simplified DES cipher.
 - mitm.py - Use meet-in-the-middle attack on double S-DES.
 
 - aes/ - Advanced Encryption Standard (AES).
- aes.py - A 128-bit AES block cipher.
 - fast_aes.py - A look-up-table implementation of AES to accelerate the algorithm.
 - block_cipher.py - Some block cipher modes of operation. (ECB/CBC/CFB)
 - cipher_gui.py - A simple GUI for our block cipher.
 
 - rsa/ - Rivest-Shamir-Adleman (RSA) cryptosystem.
- knapsack_cipher.py - A public-key cryptosystem based on knapsack problem.
 - rsa.py - A 1024-bit RSA public-key cryptosystem.
 - rsa_oaep.py - RSA with Optimal Asymmetric Encryption Padding (OAEP).
 
 - ecc/ - Elliptic-curve cryptography (ECC).
- ecc.py - The basic elliptic curve arithmetic.
 - diffie_hellman_ecc.py - The anonymous key agreement protocol over elliptic curves. (Also ECDH)
 - elgamal_ecc.py - The ElGamal public-key cryptosystem over elliptic curves.
 - sm2.py - The SM2 (GM/T 0003-2012) public-key cryptography standard.
 
 - hash/ - Cryptographic hash functions.
- sha_utils.py - Some utilities for Secure Hash Algorithm (SHA) family.
 - sha1.py - The SHA-1 (Secure Hash Algorithm 1) hash function.
 - sha3.py - The SHA-3 (Secure Hash Algorithm 3) hash function. (Also Keccak)
 - hmac.py - A HMAC (Hash-based Message Authentication Code) function with SHA.
 - birthday_attack.py - A birthday attack example on SHA3-16.
 - message_variants.py - Generate arbitrary number of message variants.
 
 - dsa/ - Digital signature algorithms.
- dsa.py - The NIST proposed DSA in Digital Signature Standard (DSS).
 - elgamal_dsa.py - The ElGamal signature scheme based on DLP.
 - schnorr_dsa.py - The Schnorr signature scheme based on DLP.
 - sm2_dsa.py - The SM2 (GM/T 0003-2012) digital signature algorithm based on ECC.
 
 - testdata/ - Test data folder.
- text.txt - A UTF-8 encoded text file contains short Chinese and English sentences.
 
 
Simplified Chinese Only!!!
This project is licensed under the terms of the MIT license.
Don't copy, learn.