Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

PDFAESStream for AES256 decoding returning -3

More
9 years 9 months ago #10677 by radaee
thanks, it better explaned this issue.
PDFAESStream defined inner structs, not encrypt a file as whole data object.
PDFAESStream split a file to many blocks, each is 4096 - padding bytes.
and, this Stream class can be run as normal java program on any platform.
u'd better using PDFAESStream to encrypt PDF files.
More
9 years 9 months ago - 9 years 9 months ago #10678 by AppStudio
So, basically, PDFAESStream cannot be used to decypt an encrypted PDF on-the-fly?

Would you have any reccomendations on how I could do this? My first attempt was to extend Document.PDFStream, but I can only get a decrypted BufferedInputStream from my decryption stream, and that lacks a tell() method, which makes the decryption stream fail...
Last edit: 9 years 9 months ago by AppStudio.
More
9 years 9 months ago - 9 years 9 months ago #10679 by radaee
i heard but not confirmed, that php can invoke java class by php-java-bridge.
so, if u using java on server, you are required to:
copy PDFAESStream class, and using PDFAESStream to encrypt PDF file.

on client, using PDFAESStream to decrypt PDF file.

sample codes:
using PDFAESStream to encrypt PDF file:
Code:
PDFAESStream stream = new PDFAESStream (); stream.open("absolute path to new file", key);//define as file1 stream.ImportFromFile("absolute path to exists PDF file.");defile as file0 stream.close();
the codes mean create file1, if not exists.
read data from file0, and write to file1.

using PDFAESStream to open:
Code:
PDFAESStream stream = new PDFAESStream (); stream.open("absolute path to encrypted file", key);//mean open file1. PDFDoc doc = new PDFDoc(); doc.OpenStream(stream, null); //do anything doc.Close(); stream.close();//it must close after Document object closed.
Last edit: 9 years 9 months ago by radaee.
More
9 years 9 months ago #10680 by AppStudio
Ah.

The problem is our app needs to download encrypted files for local playback AND the local files have to be encrypted while not in use :( Client requirement, I'm afraid, so we're not allowed to stream from server. Plus we have to use the same files on Android as on iOS, but our iOS pdf solution for this project is still our own PDF reader, so we cannot use PDFAESStream encryption server side before transmitting the file....

And we're stuck at AES256 as the minimum encryption requirement, too.

Will Radaee support AES256 decryption in the future?
More
9 years 9 months ago #10681 by radaee
better know your requirement.
it seems u have to implement PDFStream by yourself.

i mean u shall create your own PDFStream class derived from PDFStream.
and decrypt file by yourself.
Time to create page: 0.366 seconds
Powered by Kunena Forum