
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
software.amazon.cryptools:AmazonCorrettoCryptoProvider
Advanced tools
The Amazon Corretto Crypto Provider (ACCP) is a collection of high-performance cryptographic implementations exposed via standard JCA/JCE interfaces. ACCP uses AWS-LC to implement its cryptographic operations. You can find the version of AWS-LC used with each version of ACCP here: https://github.com/corretto/amazon-corretto-crypto-provider/blob/main/README.md#notes-on-accp-fips
The Amazon Corretto Crypto Provider (ACCP) is a collection of high-performance cryptographic implementations exposed via the standard JCA/JCE interfaces. This means that it can be used as a drop in replacement for many different Java applications. (Differences from the default OpenJDK implementations are documented here.) As of 2.0.0, algorithms exposed by ACCP are primarily backed by AWS-LC's implementations.
Build Name | main branch |
---|---|
Linux x86_64 | |
Linux aarch64 |
We provide complete benchmarking data from our benchmarking suite for the current tip of main
.
Build Name | Data | EC2 Instance Type |
---|---|---|
Linux x86_64 | link | c7i.xlarge |
Linux aarch64 | link | c8g.xlarge |
MessageDigest algorithms:
Mac algorithms:
Cipher algorithms:
Signature algorithms:
KeyPairGenerator:
KeyGenerator:
KeyAgreement:
SecretKeyFactory:
SecureRandom:
KeyFactory:
AlgorithmParameters:
ACCP-FIPS is a variation of ACCP which uses AWS-LC-FIPS 2.x as its cryptographic module. This version of AWS-LC-FIPS has FIPS certificate 4816.
Version 2.3.0 is the first release of ACCP-FIPS. The Maven coordinates for
ACCP-FIPS are the same as ACCP with one difference that ACCP-FIPS's
artifact ID is AmazonCorrettoCryptoProvider-FIPS
.
The table below shows which AWS-LC and AWS-LC-FIPS release versions are used in each ACCP(-FIPS) release. ACCP did not track a FIPS branch/release version of AWS-LC until ACCP v2.3.0. Before then, ACCP-FIPS simply built its tracked AWS-LC commit in FIPS mode.
ACCP(-FIPS) version | AWS-LC version | AWS-LC-FIPS version |
---|---|---|
2.0.0 | 1.4.0 | --- |
2.1.0 | 1.5.0 | --- |
2.2.0 | 1.5.0 | --- |
2.3.0 | 1.5.0 | 2.0.0 |
2.3.1 | 1.15.0 | 2.0.0 |
2.3.2 | 1.16.0 | 2.0.0 |
2.3.3 | 1.17.0 | 2.0.2 |
2.4.0 | 1.30.1 | 2.0.13 |
2.4.1 | 1.30.1 | 2.0.13 |
2.5.0 | 1.47.0 | 3.0.0 |
Notable differences between ACCP and ACCP-FIPS:
-DFIPS=1
when configuring AWS-LC's build.ACCP-FIPS is only supported on the following platforms:
Platform | FIPS support since version |
---|---|
linux-x86_64 | 2.3.0 |
linux-aarch_64 | 2.3.0 |
ACCP has the following requirements:
ACCP comes bundled with AWS-LC's libcrypto.so
, so it is not necessary to install AWS-LC on the host or container where you run your application.
If ACCP is used/installed on a system it does not support, it will disable itself and the JVM will behave as if ACCP weren't installed at all.
Installing via Maven or Gradle is the easiest way to get ACCP and ensure you will always have the most recent version. We strongly recommend you always pull in the latest version for best performance and bug-fixes.
Whether you're using Maven, Gradle, or some other build system that also pulls packages from Maven Central, it's important to specify a classifier, otherwise, one would get an empty package. The possible classifiers are as follows:
Classifier | Support since version | FIPS support since version |
---|---|---|
linux-x86_64 | 1.0.0 | 2.3.0 |
linux-aarch_64 | 2.0.0 | 2.3.0 |
osx-x86_64 | 2.3.2 | Not supported |
osx-aarch_64 | 2.3.3 | Not supported |
Regardless of how you acquire ACCP (Maven, manual build, etc.) you will still need to follow the guidance in the Configuration section to enable ACCP in your application.
Add the following to your pom.xml
or wherever you configure your Maven dependencies.
This will instruct it to use the latest 2.x
version of ACCP for Linux x86-64 platform.
For more information, please see VERSIONING.rst.
<dependency>
<groupId>software.amazon.cryptools</groupId>
<artifactId>AmazonCorrettoCryptoProvider</artifactId>
<version>[2.0, 3.0)</version>
<classifier>linux-x86_64</classifier>
</dependency>
The artifactId for FIPS builds is AmazonCorrettoCryptoProvider-FIPS
.
ACCP artifacts on Maven can be verified using the following PGP keys:
ACCP Version | PGP Key ID | Key Server |
---|---|---|
1.x | 6F189046CEE0B2C1 | keyserver.ubuntu.com |
2.x | 5EFEEFE6BD0BD916 | keyserver.ubuntu.com |
Add the following to your build.gradle
file. If you already have a
dependencies
block in your build.gradle
, you can add the ACCP line to your
existing block.
For more information, please see VERSIONING.rst.
dependencies {
implementation 'software.amazon.cryptools:AmazonCorrettoCryptoProvider:2.+:linux-x86_64'
}
For Gradle builds, the os-detector plugin could be used so that one does not have to explicitly specify the platform. Here is an example.
We provide two scripts that allow one to add ACCP to their JDKs: one for JDK8 and one for JDKs 11+. Please note that these scripts are provided as examples and for testing only.
These scripts take the version of ACCP and the classifier as input. Optionally, one can pass -FIPS
as the third argument to bundle the FIPS artifacts. To use these scripts, please set JAVA_HOME
to
the path of your desired JDK.
Usage example:
./bin/bundle-accp.sh 2.3.3 linux-x86_64
To find the available versions and classifiers, please checkout Maven central.
Some notes on the bundling scripts:
Manual installation requires acquiring the provider and adding it to your classpath. You can either download a prebuilt version of the provider or build it yourself. Adding a jar to your classpath is highly application and build-system dependent and we cannot provide specific guidance.
The most recent version of our provider will always be on our official releases page.
Please be aware that if you build the provider yourself then it will NOT work with OracleJDK. The OracleJDK requires that JCA providers be cryptographically signed by a trusted certificate. The JARs we publish via Maven and our official releases are signed by our private key, but yours will not be.
Building this provider requires a 64 bit Linux or MacOS build system with the following prerequisites installed:
GO_EXECUTABLE
.git clone --recurse-submodules
./gradlew release
build/lib
Please be aware that repackaging ACCP's published Jar files from Maven into your own "uber" or "fat" JAR file may not work on OracleJDK. The OracleJDK requires that JCE providers be cryptographically signed by a trusted certificate. The JARs we publish via Maven and our official releases are signed by our private key, but yours will not be.
Depending on how ACCP is repackaged, ACCP's existing signature may be invalidated, and you may receive one of the following exceptions:
java.util.jar.JarException: The JCE Provider file is not signed.
java.lang.SecurityException: JCE cannot authenticate the provider
java.security.NoSuchProviderException: JCE cannot authenticate the provider
If you receive one of these exceptions, then you will need to evaluate if any of the following options will work for your application and environment:
There are two possible flags which can be provided to gradlew
to build ACCP in FIPS mode:
-DFIPS=true
: This causes ACCP to be built with AWS-LC-FIPS as its underlying crypto library. The exact version of AWS-LC-FIPS used is specified in our build.gradle file. Refer to the AWS-LC FIPS documentation for the latest FIPS validation and certification status of each version.-DEXPERIMENTAL_FIPS=true
: This causes ACCP to be built with the main
branch of AWS-LC, built in FIPS mode, as its underlying crypto library. This variation of FIPS mode allows one to experiment with the latest APIs and features in AWS-LC that have not yet made it onto a FIPS branch/release.The following illustration depicts the difference these FIPS mode build options.
-DEXPERIMENTAL_FIPS=true
|
↓
AWS-LC [■]───[■]───[■]───[■]───[■]───[■] main
\
[■]───[■] AWS-LC-FIPS-X.Y.Z
↑
|
-DFIPS=true
When changing between FIPS and non-FIPS builds, be sure to do a full clean
of your build environment.
build/
directory including build artifacts from AWS-LC dependenciestest
and collect both Java and C++ coverage metrics (saved in build/reports
).classpath
file which is understandable by Eclipse and VS Code to make development easier. (This should ideally be run prior to opening ACCP in your IDE.)SINGLE_TEST
. For example: ./gradlew single_test -DSINGLE_TEST=com.amazon.corretto.crypto.provider.test.EcGenTest
(You may need to do a clean build when switching between selected tests.)There are several ways to configure the ACCP as the highest priority provider in Java.
Run the following method early in program start up: com.amazon.corretto.crypto.provider.AmazonCorrettoCryptoProvider.install()
Add the following Java property to your programs command line: -Djava.security.properties=/path/to/amazon-corretto-crypto-provider.security
where amazon-corretto-crypto-provider.security is downloaded from
amazon-corretto-crypto-provider.security (for JDK versions older than JDK15)
or amazon-corretto-crypto-provider-jdk15.security (for JDK15 or newer)
in our repository.
Modify the java.security
file provided by your JVM so that the highest priority provider is the Amazon Corretto Crypto Provider.
Look at amazon-corretto-crypto-provider.security (JDKs 11 and older)
or amazon-corretto-crypto-provider-jdk15.security (for JDKs newer than 11)
for an example of what this change will look like.
If you want to check to verify that ACCP is properly working on your system, you can do any of the following:
if (Cipher.getInstance("AES/GCM/NoPadding").getProvider().getName().equals(AmazonCorrettoCryptoProvider.PROVIDER_NAME)) {
// Successfully installed
}
if (AmazonCorrettoCryptoProvider.INSTANCE.getLoadingError() == null && AmazonCorrettoCryptoProvider.INSTANCE.runSelfTests().equals(SelfTestStatus.PASSED)) {
// Successfully installed
}
RuntimeCryptoException
if it isn't.
We generally do not recommend this solution as we believe that gracefully falling back to other providers is usually the better option.AmazonCorrettoCryptoProvider.INSTANCE.assertHealthy();
ACCP can be configured via several system properties.
None of these should be needed for standard deployments, and we recommend not touching them.
They are of most use to developers needing to test ACCP or experiment with benchmarking.
These are all read early in the load process and may be cached so any changes to them made from within Java may not be respected.
Thus, these should all be set on the JVM command line using -D
.
com.amazon.corretto.crypto.provider.extrachecks
Adds extra cryptographic consistency checks which are not necessary on standard systems.
These checks may be computationally expensive and are not normally relevant.
See ExtraCheck.java
for values and more information.
(Also accepts "ALL" as a value to enable all flags and "help" to print out all flags to STDERR.)com.amazon.corretto.crypto.provider.debug
Enables extra debugging behavior.
These behaviors may be computationally expensive, produce additional output, or otherwise change the behavior of ACCP.
No values here will lower the security of ACCP or cause it to give incorrect results.
See DebugFlag.java
for values and more information.
(Also accepts "ALL" as a value to enable all flags and "help" to print out all flags to STDERR.)com.amazon.corretto.crypto.provider.useExternalLib
Takes in true
or false
(defaults to false
).
If true
then ACCP skips trying to load the native library bundled within its JAR and goes directly to the system library path.com.amazon.corretto.crypto.provider.janitor.stripes
Takes positive integer value which is the requested minimum number of "stripes" used by the Janitor
for dividing cleaning tasks (messes) among its workers.
(Current behavior is to default this value to 4 times the CPU core count and then round the value up to the nearest power of two.)
See Janitor.java
for more information.com.amazon.corretto.crypto.provider.cacheselftestresults
Takes in true
or false
(defaults to true
). If set to true
, the results of running tests are cached,
and the subsequent calls to AmazonCorrettoCryptoProvider::runSelfTests
would avoid re-running tests; otherwise, each call to AmazonCorrettoCryptoProvider::runSelfTests
re-run the tests.com.amazon.corretto.crypto.provider.registerEcParams
Takes in true
or false
(defaults to false
).
If true
, then ACCP will register its EC-flavored AlgorithmParameters implementation on startup.
Else, the JCA will get the implementation from another registered provider (usually stock JCE).
Using JCE's implementation is generally recommended unless using ACCP as a standalone provider
Callers can choose to register ACCP's implementation at runtime with a call to AmazonCorrettoCryptoProvider.registerEcParams()
com.amazon.corretto.crypto.provider.registerSecureRandom
Takes in true
or false
(defaults to true
).
If true
, then ACCP will register a SecureRandom implementation (LibCryptoRng
) backed by AWS-LC.
Else, ACCP will not register a SecureRandom implementation, meaning that the JCA will source SecureRandom instances from another registered provider. AWS-LC will still use its internal DRBG for key generation and other operations requiring secure pseudo-randomness.
Before version 2.4.0, default was false
for FIPS builds.com.amazon.corretto.crypto.provider.nativeContextReleaseStrategy
Takes in HYBRID
, LAZY
, or EAGER
(defaults to HYBRID
). This property only affects
AES-GCM cipher for now. AES-GCM associates a native object of type EVP_CIPHER_CTX
to each Cipher
object. This property allows users to control the strategy for releasing
the native object.
HYBRID
(default): the structure is released eagerly, unless the same AES key is used. This is the
default behavior, and it is consistent with prior releases of ACCP.LAZY
: preserve the native object and do not release while the Cipher
object is not garbage collected.EAGER
: release the native object as soon as possible, regardless of using the same key or not.
Our recommendation is to set this property to EAGER
if Cipher
objects are discarded
after use and caching of Cipher
objects is not needed. When reusing the same Cipher
object, it would be beneficial to set this system property to LAZY
so that different
encryption/decryption operations would not require allocation and release of EVP_CIPHER_CTX
structure. A common use case would be having long-running threads that each would get its
own instance of Cipher
class.com.amazon.corretto.crypto.provider.tmpdir
Allows one to set the temporary directory used by ACCP when loading native libraries.
If this system property is not defined, the system property java.io.tmpdir
is used.com.amazon.corretto.crypto.provider.registerEdKeyFactory
Takes in true
or false
(defaults to false
).
If true
and JDK version is 15+, then ACCP will register its Ed25519 related KeyFactory classes.
The keys produced by ACCP's KeyFactory services for Ed25519 do not implement EdECKey
interface, and as a result, they cannot be used by other providers. Consider setting this property
to true
if the keys are only used by other ACCP services AND they are not type cast to EdECKey
.
It is worth noting that the key generated by KeyFactory service of SunEC can be used by ACCP services
such as Signature.This library is licensed under the Apache 2.0 license although portions of this product include software licensed under the dual OpenSSL and SSLeay license. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org), as well as cryptographic software written by Eric Young (eay@cryptsoft.com).
As of version 2.0.0, our backing native cryptographic library (now AWS-LC) also
has some code published under
MIT, Google's
ISC, and 3-clause
BSD licenses (among
others). Please see AWS-LC's LICENSE
file for full details.
FAQs
Unknown package
We found that software.amazon.cryptools:AmazonCorrettoCryptoProvider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.