This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Security and the fly likes SSHTools, SFTP, Bouncy Castle, JCE, AES128 CBC and other acronyms. Help me put them together. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "SSHTools, SFTP, Bouncy Castle, JCE, AES128 CBC and other acronyms. Help me put them together." Watch "SSHTools, SFTP, Bouncy Castle, JCE, AES128 CBC and other acronyms. Help me put them together." New topic
Author

SSHTools, SFTP, Bouncy Castle, JCE, AES128 CBC and other acronyms. Help me put them together.

Paul Policarp
Greenhorn

Joined: May 07, 2010
Posts: 18
Hi. I'm trying to implement a windows SFTP server using SSHTools (j2ssh) and it has to use AES 128 CBC encryption. SSHTools supposedly has classes for all this and they are all configurable in one of the configuration XMLs.

Or were.

The documentation is hardly up to date and the classes no longer exist, so I tried to recreate them. This is what my AES class looked like:



Basically I just copy-pasted their CBC DES class and replaced the essentials. I load it via the XML file but when I try to connect with a linux client and using the cipher, my server throws a socket is EOF IO exception after my client says it cannot find the AES cipher on the server, just the two that are part of the API.

So I edited the SSHTools API to make it load the AES class by default without needing the XML file.



Now whenever I try to connect, I don't get an exception, but rather the server hangs on

07.05.2010 16:27:05 com.sshtools.j2ssh.transport.cipher.SshCipherFactory newInstance
INFO: Creating new aes128-cbc cipher instance

Please help me with this. I've been working on this damned server for months now and I'm quite literally at wit's end. If you need any more information I will gladly supply it.

Thanks.
Paul Policarp
Greenhorn

Joined: May 07, 2010
Posts: 18
I've solved the problem, this thread can be closed.
Paul Policarp
Greenhorn

Joined: May 07, 2010
Posts: 18
Just in case anyone's interested, this is my cipher (and this is my gun).



Notable changes include the usage of SecretKeySpec in cipher.init and the keysize of 16 bytes (128 bits). It's working now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SSHTools, SFTP, Bouncy Castle, JCE, AES128 CBC and other acronyms. Help me put them together.
 
Similar Threads
BadPaddingException
javax.crypto with sun AND ibm...
AES Encryption Service
Problem in getting decrypted data from MySql Database
Encrypted values all contain same final characters