Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC:

PDFAESStream for AES256 decoding returning -3 8 years 11 months ago #10677

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
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.

Please Log in or Create an account to join the conversation.

PDFAESStream for AES256 decoding returning -3 8 years 11 months ago #10678

  • AppStudio
  • AppStudio's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
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...

Please Log in or Create an account to join the conversation.

Last edit: by AppStudio.

PDFAESStream for AES256 decoding returning -3 8 years 11 months ago #10679

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
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:
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:
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.

Please Log in or Create an account to join the conversation.

Last edit: by radaee.

PDFAESStream for AES256 decoding returning -3 8 years 10 months ago #10680

  • AppStudio
  • AppStudio's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
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?

Please Log in or Create an account to join the conversation.

PDFAESStream for AES256 decoding returning -3 8 years 10 months ago #10681

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
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.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum