S4 is an extensive cross platform library of cryptographic functions that can be called from the C API. It was designed to be portable, such that it can be cross-compiled for different architectures, including OS X, IOS, Linux, Android, and Windows.
Building for OS X
The OS X version of S4 is built using Xcode 7.1. and uses the S4-osx target. This will
produce the S4.Framework in the build/osx/Debug or build/osx/Release directory.
Both Xcode tests and Operational tests have been provided. The Operational tests can be built and run using the S4-optest Xcode target.
Building for IOS
The IOS version of S4 is built using Xcode 7.1. and uses the 'S4-ios static' target. This will produce the libS4.a in the build/ios/Debug or build/ios/Release directory. Only the Xcode tests which calls the Operational tests have been provided. The Xcode test Operational tests can be built and run using the S4-ios Test target.
Building for the unix OS (Linux)
The simplest way to build this project is simply to run
make host. This will
perform a build for the host OS, and should work out-of-the-box on most operating
systems, assuming standard C build tools are available.
S4 allows the programmer to make high level C calls without having to have expertise in the low level cryptography algorithms. It presents the interface in a consistant usable structure.
The following Hash Algorithms are supported:
- SHA-1, 224, 256, 384, 512, 512/256
- SKEIN-256, 512, 1024
The following Hash API
#Message Authentication Code
Both HMAC and SKEIN version of MAC is supported. Across all the appropriate hash algorithms.
There is also a MAC_KDF utility function that is helpful for doing key derivation
#Symmetric Cryptography functions
The following ciphers are supported: AES-128, AES-192, AES-256, 2FISH-256
EBC mode calls include
CBC mode is available via:
and a higher level CBC encode/decode with padding
#Tweekable Block cipher
Threefish is supported in 256, 512 and 1024 bit mode.
#ECC Public Key functions
supported Keysizes are ECC-384 and 414 (Bernstien/Lange Curve41417)
Shamir secret Splitting
Generate PGP hash codes
#S4 Keys API
S4 also provides a higher level API to take cryptographic keys and convert back and forth from a JSON representation.
Keys are maintained in an internal S4KeyContextRef format and can be created and manipulated using the following API calls.
- S4Key_GetProperty, SCKeyGetAllocatedProperty
Keys pointed to by the S4KeyContextRef can be converted back and forth to JSON using
and can be decoded back to original format using