GithubHelp home page GithubHelp logo

pvasa / easycrypt Goto Github PK

View Code? Open in Web Editor NEW
109.0 109.0 20.0 667 KB

Android cryptography library with SecureRandom patches.

License: Apache License 2.0

Kotlin 92.93% Java 6.82% Shell 0.24%
android cryptography decryption encryption hashing kotlin

easycrypt's People

Contributors

pvasa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

easycrypt's Issues

1.3.5 Package broken

Describe the bug
Release 1.3.5 build is broken.
https://jitpack.io/com/github/pvasa/EasyCrypt/1.3.5/build.log

To Reproduce
Steps to reproduce the behavior:
See log: https://jitpack.io/com/github/pvasa/EasyCrypt/1.3.5/build.log

Expected behavior
Library should install correctly when installed using Gradle. Currently only the randomorg package is built inside the library.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

ECResultListener is not working

I am trying to run a method once the encryption is done with the help of the ECResultListener like below:

String fileKey = "123456";
                        ECSymmetric ecSymmetric = new ECSymmetric();
                        ecSymmetric.encrypt(orginaFile, fileKey, new ECResultListener() {
                            @Override
                            public void onProgress(int newBytes, long processedBytes, long totalBytes) {

                            }

                            @Override
                            public <T> void onSuccess(T t) {
                                    Toasty.success(singleChatActivity.this, "ENCRYPTED").show(); // DOESN'T display although there is an encrypted file as an result
                            }

                            @Override
                            public void onFailure(String s, Exception e) {

                            }
                        }, encryptedFile);

Any help?

Cannot write to file.java.io.IOException: Error while finalizing cipher

I am trying to decrypt an image after the downloading from Firebase storage directly (in OnSuccessListener) and the log of the progress of decryption works till it reaches 99% and gives the following error:
Cannot write to file.java.io.IOException: Error while finalizing cipher
Please note:

  • The premissions are granted.
  • The decryption works in other locations.

Any recommendations for this?

Decryption breaks on newer Android versions

EDIT: to clarify the problem - encryption and decryption on the same platform works! The problem is when you encrypt information on some platforms and then afterwards, decryption of this data is attempted on others. I've seem compatibility problems between these ranges of API versions:

  • 22 or before,
  • 23 through 25,
  • 26 and after,

meaning, encryption-decryption between devices in each range works, but between devices in different ranges doesn't.

ORIGINAL post:

W/System.err: javax.crypto.BadPaddingException: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT
W/System.err:     at com.android.org.conscrypt.NativeCrypto.EVP_CipherFinal_ex(Native Method)
W/System.err:     at com.android.org.conscrypt.OpenSSLCipher$EVP_CIPHER.doFinalInternal(OpenSSLCipher.java:570)
W/System.err:     at com.android.org.conscrypt.OpenSSLCipher.engineDoFinal(OpenSSLCipher.java:351)
W/System.err:     at javax.crypto.Cipher.doFinal(Cipher.java:1736)
W/System.err:     at com.pvryan.easycrypt.symmetric.performDecrypt.invoke$easycrypt_release(performDecrypt.kt:70)
W/System.err:     at com.pvryan.easycrypt.symmetric.ECSymmetric$decrypt$1.invoke(ECSymmetric.kt:209)
W/System.err:     at com.pvryan.easycrypt.symmetric.ECSymmetric$decrypt$1.invoke(ECSymmetric.kt:44)
W/System.err:     at org.jetbrains.anko.AsyncKt$doAsync$1.invoke(Async.kt:140)
W/System.err:     at org.jetbrains.anko.AsyncKt$doAsync$1.invoke(Unknown Source:0)
W/System.err:     at org.jetbrains.anko.AsyncKt$sam$Callable$761a5578.call(Unknown Source:2)
W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/System.err:     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
W/System.err:     at java.lang.Thread.run(Thread.java:764)

It seems that this library is experiencing the same issue found in this other library below (in an older version, they fixed it by enforcing usage of Bouncy Castle instead of the new default provider on Android 6.0 onwards).

AArnott/PCLCrypto#61

Please also make this library enforce usage of Bouncy Castle as well as a workaround at least until a fix is found using the new provider on API 23 onwards.
EDIT: As I mention below, apparently just doing this workaround won't be enough :(

I tested on an emulator with API 26.

Thank you!

E/Cannot write to file.: java.io.IOException: Error while finalizing cipher when decrypting on another device

I am trying to send encrypted files through Firebase storage, when the same encryption/decryption works pretty fine on the same device where I encrypt the data, it gives the following error after 99% of the decryption on another device:

E/Cannot write to file.: java.io.IOException: Error while finalizing cipher

Please note that the encryption string key is the same and also the same function to decrypt the file in both devices. Is there something I am missing here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.