How to get SHA-1 and SHA-256 from Android Studio

SHA-1 and SHA-256 are used in Firebase OAuth and Dynamic links

Gnanendra Prasad P
3 min readJun 12, 2020
How to get SHA-1 and SHA-256 from Android Studio by Gnanendra Prasad
How to get SHA-1 and SHA-256 from Android Studio

SHA-1(Secure Hash Algorithm-1) is a cryptographic term or cryptographic hash function which takes an input and produces a 160-bit (20 bytes) hash value known as a message digest. It is typically rendered as a hexadecimal number which is 40 digits long.

Android Studio has two forms of SHA

  1. SHA-1 fingerprint certificate
  2. SHA-256 fingerprint certificate
  • SHA-1 is used to create an OAuth2 client and API key for your app
  • SHA-256 is used for configuring Firebase Dynamic links

How to get SHA-1 and SHA-256 from Android Studio

Follow these steps to get both SHA-1 and SHA-256:

  1. Open any Android Studio Project (recommended version is Android Studio 3.6+)
  2. On the right side of your project, you’ll see Device Explorer, Flutter Inspector(If installed), and Gradle.
MainActivity | Get SHA-1 and SHA-256 from Android Studio by Gnanendra Prasad
MainActivity | How to get SHA-1 and SHA-256 from Android Studio

3. Click Gradle and expand the <project name> tab. It looks like below-

Gradle | Get SHA-1 and SHA-256 from Android Studio by Gnanendra Prasad
Gradle | How to get SHA-1 and SHA-256 from Android Studio

4. After step 3 follow the below events

<project name> → android → signing Report

5. After clicking the signing report, a terminal panel will open which shows your SHA-1, SHA-256, and MD5.

Execution Terminal | Get SHA-1 and SHA-256 from Android Studio by Gnanendra Prasad
Execution Terminal | How to get SHA-1 and SHA-256 from Android Studio

6. Copy SHA-1 and SHA-256 and use them wherever it is necessary.

SHA-1 & SHA-256 | Get SHA-1 and SHA-256 from Android Studio by Gnanendra Prasad
SHA-1 & SHA-256 | How to get SHA-1 and SHA-256 from Android Studio

Note

  1. SHA-1 and SHA-256 have validity. Make sure to change it wherever you need it before it expires.
  2. It will also be saved in the Android Project directory with .keystore extension. This will be used while uploading your app to Google PlayStore.

If you like what you just read, Please clap, share, and comment below so that others might stumble upon this blog. For more blogs like this, please scroll down and Follow Gnanendra Prasad P or click here.

--

--

Gnanendra Prasad P
Gnanendra Prasad P

Written by Gnanendra Prasad P

Spring Boot Developer | Tech Enthusiast | Mendix Rapid Certified | Kony