Comments (12)
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.
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.
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.
I would like to suggest 7z or gz as an option since they both support encrypted password protection.
from android.
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.
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.
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.
Well, it looks like I'm going to implement this as a way to password-protect a .zip export. Reason as follows:
- Stocard supplies password-protected zip files when you ask for your data, so I have to support opening password protected zip files
- 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)
- 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.
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.
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.
Hii..Thanks for the detailed guidelines!
So just as per your advice above, I -
- Created a new method
multipleCardsExportImportPasswordProtected()
in ImportExportTest.java - Added a 5th Parameter
char[] password
in exportData() method of MultiFormatExporter Class. - Stored a
final String password = "some_password"
within themultipleCardsExportImportPasswordProtected()
method itself and passed it as a parameter toimportData()
as well asexportData()
method calls of this method. - Everywhere else that
exportData()
is called in the project, password parameter being passed isnull
.
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.
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)
- Exclude archived cards in ShortcutHelper HOT 1
- created data marix does not contain the proper information HOT 4
- Improve design of multi-barcode picker
- Sandbox PdfRenderer in a Service with android:isolatedProcess
- Highlight archived cards HOT 2
- Display loyalty cards as a text list, without thumbnails HOT 6
- Hide Card ID for binary content? HOT 2
- Loyalty card shortcut not updating with latest card information HOT 2
- About screen text can overflow into arrow HOT 1
- Proposal to Enhance Testing Infrastructure and Automate Workflows HOT 1
- Incorrect Implementation of describeContents() in LoyaltyCard Class HOT 3
- Google Play: "Can't install Catima (2.29.0)" HOT 3
- Errors in Spanish Translation HOT 1
- Cannot save balance in Arabic
- Option to disable the edit button on the lock screen HOT 3
- FR: Share text to app instead of image HOT 4
- Shortcut in control panel HOT 1
- Unable to open a card from the device control quick settings tile HOT 10
- Add an attached document (PDF) HOT 8
- can android.hardware.camera use required=false? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android.