cMDA
is a versatile cryptographic library for hashing operations. It supports MD2, MD4, and MD5 standards. The library includes:
- A collection of headers for seamless integration into your applications.
- Command-line utilities for hashing messages and files.
Users can clone the source code and build the library and binaries using make
.
- By default, the library will be installed in
C:\Byte-Ocelots
. - To specify a custom installation directory, use:
make install INSTALL_DIR="path\to\install"
- By default, the library will be installed in
/usr/local
. - To specify a custom installation directory, use:
make install PREFIX="path/to/install"
Include the desired header files in your application:
- To include all supported MD versions:
#include <cMDA/all.h>
- To include specific versions, use:
#include <cMDA/md2.h> // For MD2 #include <cMDA/md4.h> // For MD4 #include <cMDA/md5.h> // For MD5
Following are the available functions:
uint8_t *cMD2(uint8_t *message, uint64_t message_len, uint8_t *digest); // For MD2
uint8_t *cMD4(uint8_t *message, uint64_t message_len, uint8_t *digest); // For MD4
uint8_t *cMD5(uint8_t *message, uint64_t message_len, uint8_t *digest); // For MD5
example:
#include "cMDA/all.h" // all cMDA functions
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(void) {
char * message = "your message";
uint8_t md2_digest[MD2_DIGEST_LENGTH];
uint8_t md4_digest[MD4_DIGEST_LENGTH];
uint8_t md5_digest[MD5_DIGEST_LENGTH];
cMD2((uint8_t *)message, strlen(message), md2_digest);
cMD4((uint8_t *)message, strlen(message), md4_digest);
cMD5((uint8_t *)message, strlen(message), md5_digest);
return 0;
}
When compiling your application, link against the cMDA
library using the -lcMDA
flag:
gcc your_program.c -lcMDA -o your_program
The library includes terminal-based binaries for hashing operations:
- Usage:
Example for MD5:
md[version] "your message"
md5 "This is a test message"
- To hash files, use the
-f
option:md5 -f "path/to/file"
- Multiple files and messages can be passed simultaneously.
Run the following to build both the libraries and binaries:
make all
To build just the binaries:
make build
Pass a specific compiler using:
make CC="your-compiler"
Specify the architecture for Linux builds:
- Default: Uses the compiler’s default architecture.
- To specify:
make arch=32
make arch=64
Windows builds rely on the architecture supported by the provided compiler, as multilib is not supported.
This library is open source and available under the terms of the MIT License.