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,614
  • 7
  • 27
  • 40
Kurtoid
  • 207
  • 7
  • 14

2 Answers2

2

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

Zenadix
  • 13,493
  • 3
  • 24
  • 40
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,614
  • 7
  • 27
  • 40