Key hash for Android-Facebook app Key hash for Android-Facebook app windows windows

Key hash for Android-Facebook app


Here are the steps-

  1. Download openssl from Google code (If you have a 64 bit machine you must download openssl-0.9.8e X64 not the latest version)

  2. Extract it. create a folder- OpenSSL in C:/ and copy the extracted code here.

  3. detect debug.keystore file path. If u didn't find, then do a search in C:/ and use the Path in the command in next step.

  4. detect your keytool.exe path and go to that dir/ in command prompt and run this command in 1 line-

    $ keytool -exportcert -alias androiddebugkey -keystore "C:\Documents and Settings\Administrator.android\debug.keystore" | "C:\OpenSSL\bin\openssl" sha1 -binary |"C:\OpenSSL\bin\openssl" base64

    • it will ask for password, put android
    • that's all. u will get a key-hash

For more info visit here


[EDIT 2020]-> Now I totally recommend the answer here, way easier using android studio, faster and no need to wright any code - the one below was back in the eclipse days :) -.

You can use this code in any activity. It will log the hashkey in the logcat, which is the debug key. This is easy, and it's a relief than using SSL.

PackageInfo info;try {    info = getPackageManager().getPackageInfo("com.you.name", PackageManager.GET_SIGNATURES);    for (Signature signature : info.signatures) {        MessageDigest md;        md = MessageDigest.getInstance("SHA");        md.update(signature.toByteArray());        String something = new String(Base64.encode(md.digest(), 0));        //String something = new String(Base64.encodeBytes(md.digest()));        Log.e("hash key", something);    }} catch (NameNotFoundException e1) {    Log.e("name not found", e1.toString());} catch (NoSuchAlgorithmException e) {    Log.e("no such an algorithm", e.toString());} catch (Exception e) {    Log.e("exception", e.toString());}

You can delete the code after knowing the key ;)


I've created a small tool for Windows and Mac OS X. Just throw in the key-store file, and get the hash key.

If you want the default debug.keystore file, use the default alias and password. Else, use your own keystore file and values.

Check it out, download the Windows version or download the Mac OS X version(Dev-Host might be down sometimes... so if the link is broken, PM me and I'll fix it).

I hope that help you guys...

Dec 31, 2014 - EDIT:Changed host to AFH.Please let me know if the links are broken

Nov 21, 2013 - EDIT:

As users requested, I added a default keystore location and a DONATE button. Feel free to use it if I've helped you. :)

Screen shotScreen shot 2