johannes-schliephake / nextcloud-passwords-ios

An iOS client for the Nextcloud Passwords app
GNU Affero General Public License v3.0
84 stars 9 forks source link

Custom PIN code #232

Open crustulumtheoneandonly opened 2 years ago

crustulumtheoneandonly commented 2 years ago

Please add option to add an app code different from device code

johannes-schliephake commented 2 years ago

Can you clarify your issue? Especially what you mean by app code and device code.

crustulumtheoneandonly commented 2 years ago

I recently lost my phone and I realized, that when the phone code is known, the passwords app can be used. Thats a security concern for me. I still want the offline caching, so the only option would be to add the possibility to set a custom app code (like Protonmail or Authy do)

johannes-schliephake commented 2 years ago

Thank you for your clarification.

So what you already can do is enabling CSE / client side encryption (what you should do anyways to secure your data). Then the app will ask for your chosen password which is different from your device's code. If you don't enable the toggle for storing the CSE password you will be asked for it each time your data is decrypted.

This is pretty close to what you need. If you still want a custom code to lock the app, I can look into it. But considering the setup above it would be a really niche use case and therefore a lower priority issue.

crustulumtheoneandonly commented 2 years ago

That sounds great, but somehow I don’t get it to work. By default, the CSE is enabled in password app settings. When I turn it off and turn it on again, there is no password prompt and I can still open the app without entering any password.

Am I doing something wrong? How can I enable it to ask for a password everytime I open the passwords app?

This security problem is even greater because of:

if you use iCloud to lock your stolen iPhone “ Mark as lost”, the iPhone can be unlocked with the right iPhone lock screen code. So through this chain. We have the complete password app and all the passwords protected by four digit code of the iphone lock screen.

johannes-schliephake commented 2 years ago

Here is a guide on how to enable CSE: https://git.mdns.eu/nextcloud/passwords/-/wikis/Users/Encryption/Enable-End-to-End-Encryption. Please note that you will be asked for your CSE password every time you access Nextcloud Passwords via the web app and you can't disable CSE without a bit of work.

By the way: You can (and should) set a 6-digit PIN for your device instead of a 4-digit one. It's also possible to set an alphanumeric password of any length as a code.

crustulumtheoneandonly commented 2 years ago

Great! Thanks for the guide, I just enabled it - didn’t inform myself so much about e2e when setting the app up a few years ago.. feels better now :D (I also wrote a script to encrypt the automatic db backups server side)

and you are totally right, I should use a 6digit code and I will from now on ;)

That’s really nice so far and big thanks for your kind and patient support!

for comfort reasons I saved the e2e password in the passwords app, and I still think the custom PIN code for the app would make a nice feature :)

I know, one must always choose between comfort and security, but maybe the App PIN code + e2e password saved + offline caching is a nice middle

anyway thanks for the great work! I hope in a few months or years I will have learned enough to contribute to this project activly!

johannes-schliephake commented 2 years ago

Always happy to help! I will look into implementing a custom PIN code in the future.