Downloads and Unzip
You can download openssl for windows 32 and 64 bit from the respective links below:
https://code.google.com/archive/p/openssl-for-windows/downloads
OpenSSL for 64 Bits OpenSSL for 32 Bits
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | **"C:\Users\keshav.gera\openssl-0.9.8k_X64\bin**\openssl.exe" sha1 -binary | **"C:\Users\keshav.gera\openssl-0.9.8k_X64\bin**\openssl.exe" base64
Important change our path Here as well as install open ssl in your system
It's Working No Doubt
C:\Users\keshav.gera>keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | "C:\Users\keshav.gera\openssl-0.9.8k_X64\bin\openssl.exe" sha1 -binary | "C:\Users\keshav.gera\openssl-0.9.8k_X64\bin\openssl.exe" base64
Enter keystore password: android
**ZrRtxw36xWNYL+h3aJdcCeQQxi0=**
=============================================================
using Manually through Coding
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
private void PrintHashKey() {
try {
PackageInfo info = getPackageManager().getPackageInfo("**com.keshav.patanjalidemo Your Package Name Here**", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
}