codenameone / CodenameOne

Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.
https://www.codenameone.com/
Other
1.71k stars 408 forks source link

Possibility to Encrypt sqlite data base #3848

Open DurankGts opened 1 week ago

DurankGts commented 1 week ago

Please provide a solution to encrypt the entire database sqlite in CN1. this very import security issue.

Eric-Chomba commented 6 days ago

Try this

https://stackoverflow.com/questions/78713014/how-to-encrypt-and-decrypt-files-in-the-app-storage/78760482#78760482

DurankGts commented 6 days ago

accessing to database encrypting and decripting can impact the performace of the app. I think that create an implementation to Encrypt/decrypt sqlite data base is more eficient using native way.

DurankGts commented 6 days ago

but thank you by your response sincerilly.

Eric-Chomba commented 5 days ago

accessing to database encrypting and decripting can impact the performace of the app. I think that create an implementation to Encrypt/decrypt sqlite data base is more eficient using native way.

Encryption & decryption are fast and performance is okay as long as writer speed is optimal

https://stackoverflow.com/questions/78799260/how-can-writer-speed-be-enhanced/

For further optimization,

  1. FilesCipher class can be modified to encrypt bytes directly without encoding or decoding them to Base64
  2. FilesCipher can also be modified to encrypt using secret key only.

After these 2 modification, the encoding of the resulting encrypted database is similar to CN1Preferences which is encrypted using EncryptedStorage.install("your-pass-encryption-key")

Eric-Chomba commented 5 days ago

accessing to database encrypting and decripting can impact the performace of the app. I think that create an implementation to Encrypt/decrypt sqlite data base is more eficient using native way.

Encryption & decryption are fast and performance is okay as long as writer speed is optimal

https://stackoverflow.com/questions/78799260/how-can-writer-speed-be-enhanced/

For further optimization,

  1. FilesCipher class can be modified to encrypt bytes directly without encoding or decoding them to Base64
  2. FilesCipher can also be modified to encrypt using secret key only.

After these 2 modification, the encoding of the resulting encrypted database is similar to CN1Preferences which is encrypted using EncryptedStorage.install("your-pass-encryption-key")

accessing to database encrypting and decripting can impact the performace of the app. I think that create an implementation to Encrypt/decrypt sqlite data base is more eficient using native way.

in iOS encrypting & decrypting the same database file throws an exception when accessing it. This can be solved via this

https://stackoverflow.com/questions/78962669/how-can-bytes-array-be-handled-successfully-in-ios-using-codename-one/79001947#79001947