File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

encryption and decryption of mutimedia files

 
prasad hagargi
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,
how can i encrypt and decrypt mutimedia files using DES algorithm or any,iam trying read these files using objectinputsream and write using objectoutputstream.but iam getting "javax.crypto.Illegal BlockSizeException: Input length (with padding) not multiple of 8 bytes "exception.Please let me know ASAP what should be my aproach,should i use Java media Freamework API.
--Prasad
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you get the error when encrypting?
Pad the input to be a multiple of 8 bytes and it should go away.
Then after decoding remove the padding again (you can use an extra datablock appended to the data (8 bytes of course because of the DES requiring that) to determine how many bytes to remove).
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic