Results 1 to 6 of 6
Thread: Encrypt Password and Username
- 01-26-2011, 05:49 AM #1
Member
- Join Date
- Jan 2011
- Posts
- 30
- Rep Power
- 0
Encrypt Password and Username
Hey, I have a program that runs on a computer and connects to an SFTP server to download files. It needs to give the username and password to log in, and right now they are written out in the code. I don't want the user to be able to decomplie and see the credentials so I need to hide them somehow. I think encryption can help but I'm not familiar with how it works. Basically, I want use encrypting to get a string value that can't be seen in the code (decrypt) then login with it. Can someone please help explain some code and how I would go about doing this?
- 01-26-2011, 09:15 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,458
- Rep Power
- 16
So you want to encrypt the username and password?
And the key to the encryption (since you need to decrypt it) is going to be in the code?
How does that make it any more secure?
- 01-26-2011, 09:49 AM #3
you're right. even if you use a very efficient encryption algorithm is your code the issue is how you prevent a hacker to decompile your class. you could use an obfuscator but this wouldn't make your code much more secure. so we must look for an other approach ... any ideas? is your code executed in a unix-environment?Last edited by j2me64; 01-26-2011 at 09:56 AM.
- 01-26-2011, 03:35 PM #4
Member
- Join Date
- Jan 2011
- Posts
- 30
- Rep Power
- 0
could I convert the string to a byte and save the string value of the byte in a file (so that will look like a whole bunch of random characters) then use the code to read that and convert it back to the username and password?
- 01-26-2011, 03:40 PM #5
Member
- Join Date
- Jan 2011
- Posts
- 30
- Rep Power
- 0
Idea 2: I create some messed up strings that look unfamiliar then use code to slowly change it back to the username and password one char at a time, then putting in random stuff, deleting it out, then another of the chars, then converting it to a byte, then back, just random stuff like that and somewhere in the middle it finds the username and password, sets them to strings with random names then seemingly keeps on going with this random mess of string edits. then it logs in. After that you obfuscate, that will change all of the functions and variables even more and make it more complicated. In a way, Its a written in custom decrypt.
- 01-26-2011, 03:47 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,458
- Rep Power
- 16
Similar Threads
-
how to link url with username and password
By gb.rashu in forum JavaServer Pages (JSP) and JSTLReplies: 13Last Post: 08-12-2010, 03:12 PM -
password username and databases
By chalo in forum JCreatorReplies: 0Last Post: 12-02-2008, 08:11 AM -
username password verification
By bheezee in forum JDBCReplies: 0Last Post: 11-25-2008, 06:55 PM -
Help, created a username and password box
By cachi in forum AWT / SwingReplies: 1Last Post: 08-07-2007, 04:21 AM -
JTextFields with username & password.
By Eric in forum AWT / SwingReplies: 2Last Post: 07-01-2007, 11:41 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks