Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Viewing encrypted data with UIWebView

i am making a file browser (for any file type openable by UIWebView - images, movies, audio, text, word...), which deals with encrypted files

the problem is, what aim doing right now, is to i decrypt the file i want to view and load it in a webview request

NSURLRequest *request = [NSURLRequest requestWithURL:fileURL];  
[self.webView loadRequest: request];

however the problem is that the file is extracted to disk, to be read...

the problem is, that somebody could recover files deleted

so i tried to use

[webView loadData:documentData MIMEType:mimeType textEncodingName:textEncoding baseURL:baseDocumentURL];
  • the problem is, i can't figure out the right textEncoding (mostly utf-8 works for images and simple text), but a bigger problem is, that i cannot play audio and video possible due to the request is not loaded from file

is there a good solution for handling such a situation?

like image 480
Peter Lapisu Avatar asked Jan 23 '26 10:01

Peter Lapisu


1 Answers

I know this is an old thread, however, you can handle the decryption of data on the fly using NSURLProtocol. In regards to viewing videos, there is a bunch of other protocols you'd need to implement yourself.

like image 151
Ahmed Ebaid Avatar answered Jan 25 '26 11:01

Ahmed Ebaid