libtomcrypt: A Configurable C Cryptography Toolkit
LibTomCrypt is a fairly comprehensive, modular and portable cryptographic toolkit that provides developers with a vast array of well known published block ciphers, one-way hash functions, chaining modes, pseudo-random number generators, public key cryptography and a plethora of other routines.
At a glance
- What is it?
- libtomcrypt gives C developers configurable access to block ciphers, hashes, modes, random generation, public-key routines, and multiple-precision arithmetic backends. Its flexibility suits portable and embedded software, but build configuration and test integration require care.
- Who is it for?
- Developers should consider libtomcrypt when a C project needs configurable cryptographic primitives or multiple MPI backends. Projects that need a high-level encryption service, a fully specified random-number API, or minimal operational maintenance should first confirm those requirements against the versioned documentation and build configuration.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 52 days ago.
- What is it written in?
- Mainly C, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.
Editorial analysis
libtomcrypt's Scope and C Integration
libtomcrypt is a modular cryptographic toolkit written primarily in C. It addresses developers who need direct access to published cryptographic algorithms rather than a complete application protocol or managed cloud encryption service. Its documented scope includes block ciphers, one-way hash functions, chaining modes, pseudo-random number generators, public-key cryptography, and other low-level routines.
The library is designed to be portable across build environments. The repository includes GNU Makefiles, a shared-library makefile, UNIX and MinGW makefiles, an MSVC makefile, a Visual Studio 2008 solution, and a CMakeLists.txt file. That variety matters for C projects whose build environment may differ between a workstation, a server, and a Windows or embedded target.
libtomcrypt does not present itself as a replacement for a complete security architecture. It supplies cryptographic building blocks. Callers remain responsible for choosing appropriate algorithms, managing keys, constructing authenticated encryption correctly where required, handling random input according to the API documentation, and integrating the library with an application protocol. The README lists a broad set of routines, but it does not provide a complete algorithm inventory or usage guide for each primitive.
Build Configuration and MPI Provider Selection
The default build includes the full feature set except `katja`, with optimization adjusted according to project needs. The README says that numerous switches can reduce or alter the library. Configuration is implemented through `src/headers/tomcrypt_custom.h`, which is the first file to inspect when a target must omit algorithms or remove APIs that depend on the predefined `FILE` type.
`LTC_NO_TEST` removes algorithm self-tests from the library. `LTC_NO_FILE` removes API functions that require a predefined `FILE` data type, which the README identifies as useful for embedded targets. These options can reduce footprint, but they also remove checks or interfaces. A production build should not disable tests merely because the default build includes them without deciding what validation will replace them.
Public-key and MPI-related functionality depends on mathematical integer operations. The documented provider flags are `GMP_DESC`, `LTM_DESC`, and `TFM_DESC`, corresponding to GMP, libtommath, and tomsfastmath. The library can be built against all providers in parallel and select one at runtime. Binary tools use a separate choice through `USE_GMP`, `USE_LTM`, or `USE_TFM`, and only one provider is supported for those binaries at a time. The README also warns that tomsfastmath has a fixed maximum size for MPIs. That limit makes provider selection a deployment decision rather than a cosmetic build setting.
Building the Library with GNU Make
The repository's default `makefile` builds a static library and requires GNU Make. For a first build on a Unix-like environment, the README gives the following command.
makeThis builds the library target by default. The README also documents `makefile.shared` for a shared and static library. A project that links a shared object must use the shared build path rather than assuming that the default static build produced one.
The `test` target builds a test application described by the README as running algorithm self-tests and some extended tests. The README documents a `test` target for building the test application.
The command builds the test binary, but the README does not document its invocation syntax or expected console output. The next step is to consult the versioned documentation and `testme.sh`, then execute the test program using the project's prescribed command. The README distinguishes the test binary from the self-tests compiled into the library. `LTC_NO_TEST` should therefore be considered only after the validation plan is clear.
The `docs` target builds `doc/crypt.pdf`. The README notes that the PDF is no longer kept in the git repository and should be obtained from the appropriate version tarball or the GitHub release page.
Command-Line Utilities for Focused Validation
libtomcrypt includes utility targets that expose selected library functionality without requiring an application to be written first. The `hashsum` target builds a utility similar to `shasum`, with support for the hash algorithms included in the library. The `sizes` target prints internal data sizes, while `constants` prints internal constants. These tools are useful when checking what a particular build contains.
The `timing` target measures timings for algorithms and modes. Its presence does not establish a performance claim for a particular machine, processor, compiler, or target. The README only states that the binary can be used for measurement.
The `crypt` target builds a utility implementing behavior similar to the Unix `crypt` interface. The `openssl-enc` target builds a utility described as more or less compatible with `openssl enc`. The README marks this target as broken in some configurations, so it is not a reliable default choice for a new build.
The repository lists `all_test` as a target that builds `test`, `hashsum`, `crypt`, `small`, `tv_gen`, `sizes`, and `constants`, although the exact availability can vary between makefile variants. The README does not give command-line examples for these binaries. Their presence is useful for integration work, but their invocation must be taken from the corresponding version's documentation or source rather than inferred from names.
Portability Trade-offs and Build Boundaries
The portability story is concrete: the repository contains separate build files for GNU Make, shared libraries, unusual UNIX systems, MinGW, MSVC, Visual Studio 2008, and CMake. That reduces the need to maintain a custom build description for each listed environment. It does not mean every algorithm or utility behaves identically in every configuration. The `openssl-enc` warning and the differences between MPI providers show that build options can change available functionality.
The default build includes the entire feature set except `katja`. That is convenient for a general-purpose library build, but it can be a poor fit for a constrained embedded binary when the application needs only a small subset. `LTC_NO_FILE` addresses one class of embedded constraints, while `LTC_NO_TEST` changes the library's built-in validation. Neither switch documents a complete embedded recipe.
The project also has an ABI consideration. The README links to an ABI Laboratory tracker for API and ABI changes. Consumers who distribute binaries or link against a system package should review that tracker and version-specific headers rather than assuming that the `develop` branch is a stable ABI surface. The repository's branch policy also warns that branches other than `master` and `develop` may be force-pushed, rebased, or removed.
Maintenance Signals and Licence Review
The repository is not archived, and its last push was on 2026-09-01. Those facts show current repository activity, but they do not establish a release schedule or guarantee that a particular unreleased branch is suitable for production. The listed recent releases are `v1.18.0`, `v1.18.1`, and `v1.18.2`, with dates in 2017 and 2018. A release-oriented project must check the selected tag and its accompanying documentation rather than assuming that the latest listed release represents every current API.
The repository identifies the licence as a custom GitHub classification and points readers to the `LICENSE` file. The README does not summarize its permissions, conditions, attribution requirements, or patent language. Those terms must be reviewed in the file for the exact revision being integrated. This is especially important for a cryptography library because the licence and the code revision are separate adoption decisions.
There is also a distinction between project activity and upgrade cost. The README documents an ABI tracker and a `develop` branch for patch submissions, but it does not provide a migration guide for every API change. Consumers should pin a version, inspect its `LICENSE`, and review the ABI timeline before accepting an upgrade.
Comparing libtomcrypt with OpenSSL Commands
A direct alternative in the repository's own scope is an externally provided `openssl enc` command, which the `openssl-enc` target is intended to resemble. The difference is packaging and integration. libtomcrypt supplies a C library plus its own command-line utilities and configurable MPI providers, while the OpenSSL command is a separate executable documented by the README only as the compatibility target. The repository does not claim that its binary is fully compatible in every configuration, and it explicitly marks it broken in some configurations.
For a C library that must expose algorithms to application code, libtomcrypt's build switches are the relevant choice. For a deployment that only needs a command-line transformation and already standardizes on an external OpenSSL installation, invoking that external command avoids adding this library and its provider choices to the application. For authenticated encryption, key management, or protocol design, neither tool should be selected from this narrow compatibility description alone. The README does not document those policy decisions, so they require separate verification against the chosen version's API and security requirements.
Editorial conclusion
Developers should consider libtomcrypt when a C project needs configurable cryptographic primitives or multiple MPI backends. Projects that need a high-level encryption service, a fully specified random-number API, or minimal operational maintenance should first confirm those requirements against the versioned documentation and build configuration. Before adoption, build the selected configuration, run the `test` target, and verify that the chosen math provider and required algorithms are enabled.
Frequently asked questions
How do I build libtomcrypt on Unix?
The README says the default `makefile` builds a static library and requires GNU Make. Use `make`, or use one of the other documented makefiles for shared, unusual UNIX, MinGW, or MSVC environments.
Which math library can libtomcrypt use?
The documented MPI providers are GMP, libtommath, and tomsfastmath, selected with `GMP_DESC`, `LTM_DESC`, or `TFM_DESC`. The library can use all three in parallel, while binaries support only one provider through the corresponding `USE_` setting.
How do I remove algorithm self-tests from libtomcrypt?
Define `LTC_NO_TEST` in the library configuration. The README identifies this as removing all algorithm self-tests, so projects using that option need another validation plan.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/libtom-libtomcrypt)