Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,28 @@
![Java CI with Gradle](https://github.com/codesqueak/jackson-json-crypto/workflows/Java%20CI%20with%20Gradle/badge.svg)
[![Maven Central](https://img.shields.io/maven-central/v/com.codingrodent/jackson-json-crypto.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.codingrodent%22%20AND%20a:%22jackson-json-crypto%22)


# Jackson JSON Crypto Module

A Jackson module to support JSON encryption and decryption operations. Encryption is via AES. Key generation is password based.
A Jackson module to support JSON encryption and decryption operations. Encryption is via AES. Key generation is password
based.

Keyword: Jackson, JSON, AES, PKCS5, Encryption, Salt, Initialization Vector, IV, Java

Based on an idea from [meltmedia](https://github.com/meltmedia/jackson-crypto)

If you find this project useful, you may want to [__Buy me a coffee! :
coffee:__](https://www.buymeacoffee.com/codesqueak) Thanks :thumbsup:

## Build

Windows

```
gradlew clean build test
```

Linux

```
./gradlew clean build test
```
Expand Down Expand Up @@ -102,19 +108,6 @@ This ...
}
```

## Java Cryptography Extension (JCE) Unlimited Strength

As shipped, Java has limitations on the strength of encryption allowable. To allow full strength encryption to be used, you will need to
enable the Unlimited Strength Jurisdiction Policy.

[Policy Files](http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html)

Problems with encyption strength will usually show as an error in the following form.
```
com.codingrodent.jackson.crypto.EncryptionException: java.security.InvalidKeyException:
Illegal key size or default parameters
```

## Using Jenkins

The project includes a Jenkins file to control a pipeline build.
Expand Down
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

plugins {
id "com.github.spotbugs" version "4.5.1"
id "com.github.spotbugs" version "4.6.0"
id 'java'
id 'idea'
id 'maven-publish'
Expand Down Expand Up @@ -108,7 +108,7 @@ repositories {
}

jacoco {
toolVersion = "0.8.5"
toolVersion = "0.8.6"
reportsDir = file("$buildDir/customJacocoReportDir")
}

Expand All @@ -134,7 +134,7 @@ jacocoTestReport {
}

spotbugs {
toolVersion = '4.1.4'
toolVersion = '4.2.0'
ignoreFailures = false
effort = 'max'

Expand Down Expand Up @@ -174,22 +174,22 @@ artifactory {


dependencies {
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.11.3'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.11.3'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.11.3'
implementation group: 'org.hibernate', name: 'hibernate-validator', version: '6.1.6.Final'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.12.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.12.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.12.0'
implementation group: 'org.hibernate', name: 'hibernate-validator', version: '6.1.7.Final'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
implementation group: 'org.glassfish', name: 'javax.el', version: '3.0.0'
implementation group: 'javax.el', name: 'javax.el-api', version: '3.0.0'
//
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.7.0'
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.7.0'
testCompile group: 'org.easymock', name: 'easymock', version: '4.2'
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
testCompile group: 'org.hamcrest', name: 'hamcrest', version: '2.2'
}

wrapper {
gradleVersion = '6.7'
gradleVersion = '6.7.1'
distributionType = Wrapper.DistributionType.BIN
}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
21 changes: 3 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,29 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down