Southperry.net
Another code question - Printable Version

+- Southperry.net (https://www.southperry.net)
+-- Forum: Social (https://www.southperry.net/forumdisplay.php?fid=14)
+--- Forum: Rubik's Cube (https://www.southperry.net/forumdisplay.php?fid=58)
+--- Thread: Another code question (/showthread.php?tid=38243)



Another code question - Lord Xela - 2011-02-22

So this is a bit less simple than my last code-related question, but it's once again for my senior project. For anyone who either didn't see my last thread or just forgot, said project is a simple chatting client, written in Java, and tailored to be used by the ITS department for students who want to contact them but not use the phone. I've been implementing an encryption scheme, and at first it seemed to work just fine. Up until recently I had just been testing it with my laptop and desktop (both running Windows 7) as the two ends of the conversation and it worked fine. I'd have the occasional error with the very first message that it sent (the username), and that would end up displaying as "null" instead of what the user puts in. That was rare, though, and if it happened, the other messages went through just fine.

Recently, however, I decided to try it out with a lab computer (all of which are now iMacs). I start it up, connect, and what happens? Some sort of padding-related exception gets thrown. I believe it was a BadPaddingException, but I'm not positive - I'll try it out again tomorrow and update this with the exact error message, etc. I'm also not sure about this part, but I think it gets thrown during the Cipher.doFinal() call when I'm doing decryption (i.e. it gets the encrypted message and then craps out). I haven't tried it going from Mac to Mac, nor have I even touched Linux yet, but I'm wondering - has anyone here worked with encryption in Java and has insight on what the problem here is? I can give details of the scheme I'm using (it's slightly strange) if people want, but I'm working mostly with classes in the java.Security and javax.Crypto packages.


Another code question - AngelSL - 2011-03-01

Lord Xela Wrote:So this is a bit less simple than my last code-related question, but it's once again for my senior project. For anyone who either didn't see my last thread or just forgot, said project is a simple chatting client, written in Java, and tailored to be used by the ITS department for students who want to contact them but not use the phone. I've been implementing an encryption scheme, and at first it seemed to work just fine. Up until recently I had just been testing it with my laptop and desktop (both running Windows 7) as the two ends of the conversation and it worked fine. I'd have the occasional error with the very first message that it sent (the username), and that would end up displaying as "null" instead of what the user puts in. That was rare, though, and if it happened, the other messages went through just fine.

Recently, however, I decided to try it out with a lab computer (all of which are now iMacs). I start it up, connect, and what happens? Some sort of padding-related exception gets thrown. I believe it was a BadPaddingException, but I'm not positive - I'll try it out again tomorrow and update this with the exact error message, etc. I'm also not sure about this part, but I think it gets thrown during the Cipher.doFinal() call when I'm doing decryption (i.e. it gets the encrypted message and then craps out). I haven't tried it going from Mac to Mac, nor have I even touched Linux yet, but I'm wondering - has anyone here worked with encryption in Java and has insight on what the problem here is? I can give details of the scheme I'm using (it's slightly strange) if people want, but I'm working mostly with classes in the java.Security and javax.Crypto packages.

May I ask why you are writing Yet Another Chat System? Must you write a new one from scratch? If not, why not simply use one already available? IRC is one very good option.


Another code question - Nikkey - 2011-03-01

AngelSL Wrote:May I ask why you are writing Yet Another Chat System? Must you write a new one from scratch? If not, why not simply use one already available? IRC is one very good option.

It's for his senior project, so I suppose that's not something he's allowed to do.


Another code question - AngelSL - 2011-03-03

Devil's Sunrise Wrote:It's for his senior project, so I suppose that's not something he's allowed to do.

Oh, I didn't notice that. My bad.

Anyway without a stacktrace I can't solve anything. Sorry.