B-Con/crypto-algorithms logo

B-Con/crypto-algorithms

Free

Basic implementations of standard cryptography algorithms, like AES and SHA-1.

FreeFree tier
Type
Open Source

About B-Con/crypto-algorithms

B-Con/crypto-algorithms provides basic, public domain implementations of standard cryptographic algorithms including AES, SHA-1, MD5, Blowfish, DES, RC4, Base64, ROT-13, SHA-256, and MD2. Written from scratch by Brad Conte, these implementations are designed for educational and pragmatic purposes such as comparing specification to actual implementation code or building internal applications that compute test vectors. The code is released into the public domain free of any restrictions, acknowledged but not required. The algorithms are not cryptographically secure (no side-channel resistance) and are not optimized for speed or space; they are primarily intended to be easy to read and compile with no dependencies beyond standard C.

Key Features

Public domain code with no licensing restrictions
Educational implementations designed for easy readability
Includes AES, SHA-1, MD5, Blowfish, DES, RC4, Base64, ROT-13, SHA-256, and MD2
Self-contained source files with no external dependencies
Tested against standard test vectors
Simple compilation by adding source and header files to a project
Written from scratch without cross-licensing

Pros & Cons

Pros
  • Public domain, no licensing restrictions
  • Easy to read and understand implementation
  • Self-contained, no extra libraries or platform-specific files needed
  • Tested against standard test vectors for correctness
  • Available in C with straightforward compilation
Cons
  • Not cryptographically secure (no side-channel resistance)
  • Not optimized for speed or memory usage
  • Should not be used in production security contexts
  • Limited to basic algorithm implementations, no advanced cipher modes

Best For

Learning and understanding cryptographic algorithm specificationsComparing specification to actual implementation codeGenerating test vectors for products or internal applicationsEducational projects and cryptography studiesBuilding internal applications that require simple, non-production cryptographic functionality

FAQ

Are these implementations cryptographically secure?
No, they have no resistance to side-channel attacks and should not be used in contexts requiring cryptographic security.
Are these implementations optimized for speed or space?
No, they are designed for readability, not speed or size. Some basic optimization techniques have been employed but they are not production-grade.
Can I use this code in my project?
Yes, the code is released into the public domain with no restrictions. The author requests acknowledgement if the code is used, but does not require it.
How do I compile these algorithms?
Simply add the relevant source code and header files to your project. No additional libraries, platform-specific headers, or other complicating matters are needed.