2

I am writing a java program that uses the Bing Api. I recently decided to open source my code at code.google.com. However, I am looking for an alternative to hardcoding the key. Does anyone have any suggestions?

apxcode
  • 7,696
  • 7
  • 30
  • 41
Kurtoid
  • 217
  • 5
  • 15

2 Answers2

2

Read the password from a file, and don't upload the file to the repository.

Zenadix
  • 15,291
  • 4
  • 26
  • 41
2

Store the password as a hash in a file. Then read it from the file. You can use any already built hashing that you like.

This SO question has awesome info on how you can start hashing today: How can I hash a password in Java?

Also no need to save the file to the project, just make the path to your Desktop, for example.

Community
  • 1
  • 1
apxcode
  • 7,696
  • 7
  • 30
  • 41