Skip to content

Commit

Permalink
Version 2.0.0
Browse files Browse the repository at this point in the history
MIT License
  • Loading branch information
ademar111190 committed Oct 26, 2016
1 parent 476ea17 commit dddf2ff
Showing 1 changed file with 18 additions and 23 deletions.
41 changes: 18 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,35 @@ allprojects {

2º Add the gradle dependency
```
compile 'com.github.simbiose:Encryption:1.4.0'
compile 'com.github.simbiose:Encryption:2.0.0'
```

3º Use Encryption, choose one way below:

3 - a) Get a default Encryption instance
3º Get an Encryption instance
```
Encryption encryption = Encryption.getDefault("YourKey", "YourSalt", yourByteIvArray);
```

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
4º Encrypt your text
```
Encryption encryption = Encryption.getLowIteration("YourKey", "YourSalt", yourByteIvArray);
String encrypted = encryption.encryptOrNull("Text to be encrypt");
```

3 - c) Build a custom Encryption instance, the power in your hands
5º Decrypt your text
```
String decrypted = encryption.decryptOrNull(encrypted);
```

#Custom usage#

You can use you own builder
```
Encryption encryption = new Encryption.Builder()
.setKeyLength(128)
.setKey("YourKey")
.setSalt("YourSalt")
.setIv(yourByteIvArray)
.setCharsetName("UTF8")
.setIterationCount(65536)
.setIterationCount(1)
.setDigestAlgorithm("SHA1")
.setBase64Mode(Base64.DEFAULT)
.setAlgorithm("AES/CBC/PKCS5Padding")
Expand All @@ -51,16 +56,6 @@ Encryption encryption = new Encryption.Builder()
.build();
```

4º Encrypt your text
```
String encrypted = encryption.encryptOrNull("Text to be encrypt");
```

5º Decrypt your text
```
String decrypted = encryption.decryptOrNull(encrypted);
```

More examples see Examples folder, there is an Android and a Java project, or see the tests.

#FAQ#
Expand All @@ -73,18 +68,18 @@ More examples see Examples folder, there is an Android and a Java project, or se
- 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.
- I'm getting problems with main thread, what to do?
- Encrypt routines can take time, so you can uses the `encryptAsync` with a `Encryption.Callback`to avoid ANR'S. The same for `decryptAsync`
- I'm an older user, version 1.1 or less, what to do to update Encrypt to version 1.2+?
- I'm an older user, version 1.4 or less, what to do to update Encrypt to version 2.+?
- 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
- 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
- MIT is the project license so feel free to use it :tada:
- I'm a very older user, version 1.1 or less, what to do to update Encrypt to version 1.2+?
- 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.


##Want to contribute?##

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

##License##

GNU Lesser General Public License at version 3


###Third part###

Expand Down

0 comments on commit dddf2ff

Please sign in to comment.