Open In App

How to Generate SHA-1 Key in Flutter?

Last Updated : 19 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

SHA-1(Secure Hash Algorithm) is the unique identity of your Application. In Flutter, you can use these keys for various purposes such as adding Firebase to your app, Google Maps API integration, and more. For example, to add Firebase to your app, you need to provide the SHA-1 and SHA-256 keys to the Firebase console during setup. It generates a 160-bit Hash Value. These are the very secure Key values. If you are creating any Professional App then you should not share it with anyone as it may result in hacking of your  Application.

Note that SHA-1 is considered insecure and should not be used for new applications. SHA-256 is the recommended cryptographic hash function for generating secure digital signatures and message authentication codes Or you may say that SHA-256 is more secure than SHA-1 as SHA-256 generates a 256-bit hash value. There are various ways to generate SHA-1 keys and SHA-256 keys. In the case of Flutter Apps, it is quite difficult as compared to Android. So we will tell you how to generate both of these using a single command only in Flutter Apps.

Step by Step Implementation

Go to the Command Prompt of your Flutter Project:

Step 1: First open your Flutter Project, then go to the terminal which is located at the bottom of your project.

 

Step 2: Next step is to open the terminal and type the command in the terminal cd android.

 

Step 3: Now the most important step is to type the command ./gradlew signingReport

 

For security purposes, we have removed some digits of the SHA-1 key and SHA-256 as it may result in a data breach of the App. Majorly one command is we have to write and SHA-1 and SHA-256 keys on the fingertip. Its main use is that the inputted data is very hard to decode and our app data is encrypted and can be shared where it is needed. For when we have to store the details of our customers on Firebase.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads