0

I want to store files in a secure way for a small period of time, to be able to share the file using FileProvider, because it is sensitive data we want to encrypt the file and just decrypt it on sharing.

I was using this code to encrypt and decrypt the file:

https://developer.android.com/guide/topics/security/cryptography

But I am not sure what kind of modifications I should do in the standard implementation of a FileProvider to provide a copy of an encrypted file.

MurugananthamS
  • 2,395
  • 4
  • 20
  • 49
Darien Alvarez
  • 153
  • 2
  • 10
  • `and just decrypt it on sharing.` Ok. Decrypt on sharing. `to provide a copy of an encrypted file.` ?? Now you wanna server the encrypted file? It is unclear what you really want. – blackapps Oct 22 '19 at 08:29
  • It seems to be too late to change anything after you've shared the URL, so I suppose you'll have to do it when [sharing the URL](https://developer.android.com/reference/android/support/v4/content/FileProvider#ServeUri). It depends then where you generate the URL to perform the decryption. – Maarten Bodewes Oct 22 '19 at 22:53
  • The way I understand it an unencrypted file should be provided via the FileProvider. Is there a good way to do this? – Kai Hatje Dec 08 '19 at 09:30
  • Possible duplicate of [this question](https://stackoverflow.com/questions/59035057/work-with-encrypted-file-and-provide-them-with-fileprovider/) – Kai Hatje Jan 25 '20 at 08:56

0 Answers0