my dog learned polymorphism*
The moose likes Java in General and the fly likes Java / .NET rijndael File Encryption Interop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java / .NET rijndael File Encryption Interop" Watch "Java / .NET rijndael File Encryption Interop" New topic
Author

Java / .NET rijndael File Encryption Interop

Ola Daniel
Ranch Hand

Joined: Jul 27, 2005
Posts: 105
I need to create a Java version of an existing .NET application which uses Xceed Encryption Library to encrypt and decrypt files. I need help on how to get a Java to encrypt and decrypt files which have been encrypted with the .NET Xceed Encryption library.


See this link here for an example of how the Xceed encryption library works: http://doc.xceedsoft.com/products/XceedCry/Encrypting_and_decrypting_from_file_to_file_%28C__example%29.html

The Xceed library creates a symmetric key using a passphrase from the user. How do I do this in Java?

I already have code which generates a random secret key, this is no good. How do I create an AES 128 bit SecretKey from a given passphrase.

Any Ideas?


SCJP 1.4, SCWCD 1.4
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
- Martin Fowler et al, Refactoring: Improving the Design of Existing Code, 1999
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

How about using SecretKeySpec?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ola Daniel
Ranch Hand

Joined: Jul 27, 2005
Posts: 105
Is this correct way of doing it (see code below)? using PBEWithMD5AndDES for key factory? and MD5 hashing? Is it possible to use SHA-256 to generate a 128 bit hash?



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java / .NET rijndael File Encryption Interop
 
Similar Threads
Store HTTPS file upload on server encrypted?
AES encryption from within a Tomcat web container
wave file encryption API
string encrypt/decrypt API
How encrpyt all files on web server so decryptable by all users' keys?