Skip to content
Related Articles

Related Articles

Improve Article

How to Generate SHA1, MD5, and SHA-256 Keys in Android Studio?

  • Last Updated : 18 Feb, 2021

SHA1, MD5, and SHA-256 are cryptographic functions that will convert your input to 160 bit (20 bytes) value. It is a secure key that is used to store very important data. In Android SHA1, MD5 and SA-256 keys are very important. If you want to add external APIs from Google such as Maps and other external features inside your app, then you have to add your key to Google’s console. The SHA keys are the unique identity of your application. These keys are very important and they are required when you have to add your application to the Google Play store. In this article, we will take a look at creating these keys in Android Studio. 

1. SHA-1 Keys

SHA-1 also referred to as the Secure Hash Algorithm. It is a cryptographic hash function that will take input and it produces a 160-bit hash value. This generated hash value is known as a message digest. This generated hash value is then rendered in a hexadecimal format number which is 40 digits long. This key was designed by the United States National Security Agency which was used as an Information Processing Standard. SHA key was introduced in 1995. 

Uses of SHA-1 key: 

  • It is used for Cryptography.
  • By using this key the input data is converted into a 160-bit hash value which is difficult to decode.
  • These keys are also used for Data Integrity.

2. MD-5 Keys 

MD-5 keys are also referred to as Message Digest. These keys are faster than SHA-1 keys and they are simpler in usage than SHA-1 keys. MD-5 is having a length of 128 bits of the message digest. MD-5 is having poor security in comparison to SHA-1 keys. MD-5 key was introduced in 1992.

Uses of MD-5 key: 

  • MD-5 keys are used for Cryptography.
  • They are used to store data in 128-bit values.

3. SHA-256 Keys

SHA-256 is referred to as Secure Hash Algorithm 256. It is a cryptographic hash function that takes an input of 20 bytes and rendered this value in hexadecimal format. The value generated is known as the message digest. The generated hexadecimal value is around 40 digits long. 

Uses of SHA-256 key: 

  • SHA-256 keys are used in Cryptography.
  • They are also used in Data Integrity.

Step by Step Guide to Generate SHA1, MD5, and SHA-256 Keys in Android Studio

Step 1: For creating these keys you have to, first of all, create a new project in Android Studio or you can generate these keys in your existing projects as well. If you want to create a new project then check the article on How to Create a new Project in Android Studio.

Step 2: Now inside Android Studio Click on Gradle Tab as shown in the below image.

 Generate SHA1, MD5, and SHA-256 Keys in Android Studio

Step 3: After clicking on Gradle Tab you will get to see the below screen on which click on your “AppName”. After clicking on your App Name then you will get to see three options inside that click on the last options “app“. After clicking on the app, Navigate to “Tasks”. Inside Tasks, navigate to “android” and double click on the “signingreport” option.

 Generate SHA1, MD5, and SHA-256 Keys in Android Studio

After clicking on the “signing report” your keys will be generated as shown in the below screenshot.

 Generate SHA1, MD5, and SHA-256 Keys in Android Studio

You can use these keys while integrating Firebase into your App. When you want to add Google APIs inside your app then these keys are very important. 

Want a more fast-paced & competitive environment to learn the fundamentals of Android?
Click here to head to a guide uniquely curated by our experts with the aim to make you industry ready in no time!
My Personal Notes arrow_drop_up
Recommended Articles
Page :