Michaelin007/n-cryptography

★ 4Forks 0CGitHub ↗Compare

README

Cryptography Library in C

This project leverages the OpenSSL library to implement cryptographic algorithms in C. It currently supports the following algorithms:

  • Hashing: SHA-256 (Secure Hash Algorithm)
  • Symmetric Encryption: AES (Advanced Encryption Standard)

This library is designed for educational purposes and as a foundation for building more complex cryptographic applications.


Features

  • SHA-256 Hashing: Generate a fixed-size 256-bit (32-byte) hash from an input string.
  • AES Encryption/Decryption: Encrypt and decrypt data using the AES-128 algorithm in ECB mode.

Dependencies

This project requires the OpenSSL library to be installed on your system.

Installation Instructions

  • Debian/Ubuntu:
    sudo apt install libssl-dev
    
  • Arch Linux:
    sudo pacman -S libssl-dev
    
  • Mac OS:
    brew install openssl
    

Manual Compilation

For compilation, you can use the following commands:

SHA-256 Hashing

gcc -o test_hash tests/test_hash.c src/crypto_hash.c -lssl -lcrypto
./test_hash

gcc -o test_aes tests/test_aes.c src/crypto_aes.c -lssl -lcrypto
./test_aes

Contributors

Michaelin007

Issues