Update versions and documentation
This commit is contained in:
@@ -13,7 +13,7 @@ Maven dependency is available at:
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>rs.in.zivanovic</groupId>
|
<groupId>rs.in.zivanovic</groupId>
|
||||||
<artifactId>j-password-obfuscator</artifactId>
|
<artifactId>j-password-obfuscator</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
## Typical usage
|
## Typical usage
|
||||||
@@ -23,8 +23,7 @@ Maven dependency is available at:
|
|||||||
Say we want to obfuscate our super secret data string "Hello World" using the secret key "key".
|
Say we want to obfuscate our super secret data string "Hello World" using the secret key "key".
|
||||||
We'd use the following snippet:
|
We'd use the following snippet:
|
||||||
|
|
||||||
JPasswordObfuscator obfuscator = new JPasswordObfuscator();
|
String obfuscated = new Obfuscated("key".toCharArray(), "Hello World").toString();
|
||||||
String obfuscated = obfuscator.obfuscate("key".toCharArray(), "Hello World".getBytes(StandardCharsets.UTF_8));
|
|
||||||
System.out.println(obfuscated);
|
System.out.println(obfuscated);
|
||||||
|
|
||||||
output will resemble this:
|
output will resemble this:
|
||||||
@@ -40,8 +39,7 @@ As with all secret keys, it is recommended to use random, or, at least, not easi
|
|||||||
|
|
||||||
When we want to un-obfuscate data:
|
When we want to un-obfuscate data:
|
||||||
|
|
||||||
JPasswordObfuscator obfuscator = new JPasswordObfuscator();
|
String original = new Unobfuscated("key".toCharArray(), "$rizobf$1$l7IwmuwEZnY=$F5K7LeIP0u1cSluV3wBXqQ==").asString();
|
||||||
String original = obfuscator.deObfuscate("key".toCharArray(), "$rizobf$1$l7IwmuwEZnY=$F5K7LeIP0u1cSluV3wBXqQ==");
|
|
||||||
System.out.println(original);
|
System.out.println(original);
|
||||||
|
|
||||||
and we get our original super secret data back:
|
and we get our original super secret data back:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>rs.in.zivanovic</groupId>
|
<groupId>rs.in.zivanovic</groupId>
|
||||||
<artifactId>j-password-obfuscator</artifactId>
|
<artifactId>j-password-obfuscator</artifactId>
|
||||||
<version>1.0.1-SNAPSHOT</version>
|
<version>1.1.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>JPasswordObfuscator library</name>
|
<name>JPasswordObfuscator library</name>
|
||||||
|
|||||||
Reference in New Issue
Block a user