Today I am more than proud to reveal my first release of an OSS. Together with the rest of the Some-Sec 1 team, we decided to open source our Java crypto library.
We call it some-crypto and you can download it from maven central.
In the upcoming weeks I will publish a tool that I have been working on already for some time, that will utilize this library.
The fastest way to get going is to use the maven dependency declaration below.
<dependency>
<groupId>com.some-sec.libs</groupId>
<artifactId>some-crypto</artifactId>
<version>1.0.7</version>
</dependency>
Here you can see a simple example on how to generate a secret key and use it to encrypt some plain data.
public static void main(String... args) {
Security.addProvider(new BouncyCastleProvider());
final ConfigurationResolver resolver = new ConfigurationResolverImpl();
final EncryptionService encryptionService = new EncryptionServiceImpl(Collections.singletonList(new AESEncryption(resolver)));
final KeyOperation keyOperation = new DefaultKeyOperationImpl(resolver);
final Key key = keyOperation.generateSecretKey();
byte[] encryptedBytes = encryptionService.encrypt("Lorem ipsum".getBytes(StandardCharsets.UTF_8), key);
System.out.println("Your key: " + Base64.getEncoder().encodeToString(key.getEncoded()));
System.out.println("Your Cipher Text: " + Base64.getEncoder().encodeToString(encryptedBytes));
}
Special thanks go to @deglen and @Azgarreth ↩︎