0

I am demonstrating my java project to a couple of lecturers and they will also have access to my code. In my project, I sent an email using my own email. I have to set the password for my email in the code. Is it possible to obscure the password from the lecturers without setting the password at run time?

David031
  • 119
  • 1
  • 2
  • 8
  • 1
    you need to encrypt it before storing. – Ankit Jul 30 '13 at 14:07
  • take a look http://stackoverflow.com/questions/7979604/java-two-way-encryption-library – Daniel Robertus Jul 30 '13 at 14:15
  • Not sure if this would help, but - Store your e-mail address, password and whatever else isn't common to all e-mail addresses in a separate file. That way they can look at your code all they like, but, without the file, they your personal details is safe. Preferably encrypted, but I probably wouldn't bother for a University project. – Bernhard Barker Jul 30 '13 at 14:20
  • @ user1960972 : to 'send' you really do not need password. – Jayan Jul 30 '13 at 14:23
  • 1
    You could encrypt it, but unless that's part of your assignment, wouldn't it be simpler to just create a separate e-mail account and use it for that project? – Thiago Arruda Jul 30 '13 at 14:24
  • @Jayan You probably need to log in (likely with a password) to some mail server somewhere. Though you might not need to log into **your** account since it is possible to send as someone else (if you really have to send it as yourself, otherwise just send it via that account). – Bernhard Barker Jul 30 '13 at 14:28
  • @ Dukeling : ofcourse. – Jayan Jul 30 '13 at 14:33
  • Thanks for the replies. I'm using Authenticator which requires the password. What I think would be ideal is to have the encrypted password in my code and decrypt it at run-time. No external files. – David031 Jul 30 '13 at 15:00
  • Would the key also be in the code? If so, I hope you see the problem with that, but you simply assume that your lecturers aren't malicious and don't have *that* kind of sense of humour. – Bernhard Barker Jul 30 '13 at 15:24
  • @Dukeling I see what u mean. This isn't a must for the project, just looks more impressive. I'll probably set up a new email account as pointed out by thiago. It actually makes more sense, so the lecturers can log in and check the actual result. thanks all. – David031 Jul 30 '13 at 15:37

0 Answers0