Code Monkey home page Code Monkey logo

Comments (12)

ankittiwari101 avatar ankittiwari101 commented on August 20, 2024 2

Hii.. I want to take up this issue as it is both good-first-issue and hacktoberfest tagged.

Could you please quickly get me upto speed on what needs to be done and the concerned Activity(s) where I would need to focus my energies?

Also I am new to this whole Encryption business so please provide resources/links for me to be able to learn the required basics.

from android.

TheLastProject avatar TheLastProject commented on August 20, 2024 1

Comment by trymeouteh
Tuesday Sep 17, 2019 at 02:37 GMT


I would like to suggest using 7z. 7z are compressed files, therefore all you will need to do is integrate 7zip into the app and when it does the export, you will set a password and it will create the backup file and then out it inside a compressed 7z file with a password.

from android.

TheLastProject avatar TheLastProject commented on August 20, 2024 1

I am thinking it may make most sense to add an option to send the backup data to another app instead of writing it to SD card directly. Something like OpenKeyChain. That way we can also be sure the encrypting and decrypting is done by an app following best security practices.

from android.

trymeouteh avatar trymeouteh commented on August 20, 2024

I would like to suggest 7z or gz as an option since they both support encrypted password protection.

from android.

djechelon avatar djechelon commented on August 20, 2024

Shouldn't be Google Drive backups encrypted with the old phone's PIN? I am definitely sure about it. If privacy is a concern, one would not (as I did before A10) enable GDrive backups

from android.

IllusiveMan196 avatar IllusiveMan196 commented on August 20, 2024

Maybe Aegis Authenticator can be used as a reference? It has password encrypted backup option, scheduled backups and biometric unlock. Before doing it all though best would be to contact devs - beemdevelopment. Basically you could solve this issue and app password protection as well.

from android.

seniorm0ment avatar seniorm0ment commented on August 20, 2024

Yes, I would agree. The encryption would be best to be sent and handled to another app such as OpenKeychain with PGP.

Another more complicated idea would be to offer the data as an export into a format that can be imported into Keepass (CSV?). But it would allow more universability if a user wanted to migrate the data away from Catima for whatever reason.

from android.

TheLastProject avatar TheLastProject commented on August 20, 2024

Well, it looks like I'm going to implement this as a way to password-protect a .zip export. Reason as follows:

  1. Stocard supplies password-protected zip files when you ask for your data, so I have to support opening password protected zip files
  2. Next Catima release will support images (see #15) and it just makes sense to change exporting from .csv to .zip to make it easier for end-users to use their data in other programs if wanted (and it will take less space than base64-encoding the image as text)
  3. The library I chose to read password-protected zip files (zip4j) supports using AES encryption mode to create password protected zips too very easily: https://github.com/srikanth-lingala/zip4j#creating-a-password-protected-zip-file--adding-files-to-an-existing-zip-with-password-protection

Not quite sure how secure the AES implementation is though, but I hope this will still make y'all happy anyway without making me spend a lot of time on this?

from android.

TheLastProject avatar TheLastProject commented on August 20, 2024

I am tagging this as "good first issue" because the only things needed to implement this would be a dialog to enter the desired password and setting the password for zip4j to use in the export. Should not be very hard for anyone interested in this feature to pick up.

from android.

TheLastProject avatar TheLastProject commented on August 20, 2024

Well, in this case the easiest thing would probably be to start with the unit test. That way you can try your changes very quickly.

So first, copy the multipleCardsExportImport to multipleCardsExportImportPasswordProtected or something like that: https://github.com/TheLastProject/Catima/blob/2128f0a601b5affd660ad6dd15e88026f6e3b92d/app/src/test/java/protect/card_locker/ImportExportTest.java#L326-L355

Make up some password, replace null in the importData line with that password and add a new password parameter with the same password to exportData.

Then, modify the exportData function to encrypt the data with a password if the password value is not null, as written in the zip4j documentation: https://github.com/srikanth-lingala/zip4j#creating-a-password-protected-zip-file--adding-files-to-an-existing-zip-with-password-protection.

After that, expand the export code to create a dialog and ask the user for a password they want to use: https://github.com/TheLastProject/Catima/blob/2128f0a601b5affd660ad6dd15e88026f6e3b92d/app/src/main/java/protect/card_locker/ImportExportActivity.java#L408-L422.

Feel free to make the pull request early in development and mark it as Draft so I can guide you along the way.

from android.

ankittiwari101 avatar ankittiwari101 commented on August 20, 2024

Hii..Thanks for the detailed guidelines!

So just as per your advice above, I -

  1. Created a new method multipleCardsExportImportPasswordProtected() in ImportExportTest.java
  2. Added a 5th Parameter char[] password in exportData() method of MultiFormatExporter Class.
  3. Stored a final String password = "some_password" within the multipleCardsExportImportPasswordProtected() method itself and passed it as a parameter to importData() as well as exportData() method calls of this method.
  4. Everywhere else that exportData() is called in the project, password parameter being passed is null.

Now where I am facing some difficulty is passing password to zip4j.
From the examples I saw on zip4j github page, all have one particular line in common -
new ZipFile("filename.zip").addFile("filename.ext");

Password parameters can be added but this line seems to be non - optional. However, I couldn't find this line anywhere in the project. So I am having hard time determining where to add the encryption code. Please guide me on this.

from android.

TheLastProject avatar TheLastProject commented on August 20, 2024

The zip4j documentation indeed seems to be slightly lacking. Looking at https://github.com/srikanth-lingala/zip4j/blob/2ec68db8b7dcac1e6867362c3cb1c80d5d793762/src/main/java/net/lingala/zip4j/io/outputstream/ZipOutputStream.java#L52-L54, it seems you can define a password in ZipOutputStream. Maybe that'll work?

from android.

Related Issues (20)

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.