Skip to content

Commit dddf2ff

Browse files
committed
Version 2.0.0
MIT License
1 parent 476ea17 commit dddf2ff

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

README.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,35 @@ allprojects {
1919

2020
2º Add the gradle dependency
2121
```
22-
compile 'com.github.simbiose:Encryption:1.4.0'
22+
compile 'com.github.simbiose:Encryption:2.0.0'
2323
```
2424

25-
3º Use Encryption, choose one way below:
26-
27-
3 - a) Get a default Encryption instance
25+
3º Get an Encryption instance
2826
```
2927
Encryption encryption = Encryption.getDefault("YourKey", "YourSalt", yourByteIvArray);
3028
```
3129

32-
3 - b) Get a low iteration Encryption instance. It is similar to previous way, but it is faster once it use only 1 iteration instead of 65536
30+
4º Encrypt your text
3331
```
34-
Encryption encryption = Encryption.getLowIteration("YourKey", "YourSalt", yourByteIvArray);
32+
String encrypted = encryption.encryptOrNull("Text to be encrypt");
3533
```
3634

37-
3 - c) Build a custom Encryption instance, the power in your hands
35+
5º Decrypt your text
36+
```
37+
String decrypted = encryption.decryptOrNull(encrypted);
38+
```
39+
40+
#Custom usage#
41+
42+
You can use you own builder
3843
```
3944
Encryption encryption = new Encryption.Builder()
4045
.setKeyLength(128)
4146
.setKey("YourKey")
4247
.setSalt("YourSalt")
4348
.setIv(yourByteIvArray)
4449
.setCharsetName("UTF8")
45-
.setIterationCount(65536)
50+
.setIterationCount(1)
4651
.setDigestAlgorithm("SHA1")
4752
.setBase64Mode(Base64.DEFAULT)
4853
.setAlgorithm("AES/CBC/PKCS5Padding")
@@ -51,16 +56,6 @@ Encryption encryption = new Encryption.Builder()
5156
.build();
5257
```
5358

54-
4º Encrypt your text
55-
```
56-
String encrypted = encryption.encryptOrNull("Text to be encrypt");
57-
```
58-
59-
5º Decrypt your text
60-
```
61-
String decrypted = encryption.decryptOrNull(encrypted);
62-
```
63-
6459
More examples see Examples folder, there is an Android and a Java project, or see the tests.
6560

6661
#FAQ#
@@ -73,18 +68,18 @@ More examples see Examples folder, there is an Android and a Java project, or se
7368
- You have the power to handle the exceptions, instead of uses `encryptOrNull` method just uses the `encrypt` method. The same for the `decryptOrNull`, just uses the `decrypt` method.
7469
- I'm getting problems with main thread, what to do?
7570
- Encrypt routines can take time, so you can uses the `encryptAsync` with a `Encryption.Callback`to avoid ANR'S. The same for `decryptAsync`
76-
- I'm an older user, version 1.1 or less, what to do to update Encrypt to version 1.2+?
71+
- I'm an older user, version 1.4 or less, what to do to update Encrypt to version 2.+?
72+
- The library has changed the default iteration count from 65536 to 1, it improve the performance, if you have a code using the old version or if you prefer to use a big iteration count you just need to use a custom builder instead of get the default builder and set the iteration count you want
73+
- As far as the library uses 1 as default iteration count we do not need anymore the getLowIteration and it was removed from project, if you use it you can just change to getDefault
74+
- MIT is the project license so feel free to use it :tada:
75+
- I'm a very older user, version 1.1 or less, what to do to update Encrypt to version 1.2+?
7776
- The library has several changes in his structure in version 1.2, both in algorithm and in code usage, so if you are an older user you need migrate the encrypted stuff or configure the `Builder` manually to the same parameters used in version 1.1 and olds.
7877

7978

8079
##Want to contribute?##
8180

8281
Fell free to contribute, We really like pull requests :octocat:
8382

84-
##License##
85-
86-
GNU Lesser General Public License at version 3
87-
8883

8984
###Third part###
9085

0 commit comments

Comments
 (0)