What is a SHA1 fingerprint?
Asked Answered
S

6

19

I am obtaining a Google Play API key from Google, and it is asking to enter SHA1 fingerprint. I want to know what is SHA1 fingerprint? I also wanted to know whether this API key can be used from another computer?

Stateless answered 5/9, 2014 at 11:41 Comment(0)
A
6

It is a standard for the implementation of a 'secure hash algorithm' - a one-way cryptographic function that can be used to act as a 'signature' of a sequence of bytes. It is very unlikely that 2 different byte sequences would produce the same value (though not impossible)

http://en.wikipedia.org/wiki/SHA-1

Note that there are other, more robust standards out there these days e.g. SHA256 and beyond.

Ancipital answered 5/9, 2014 at 11:49 Comment(2)
sir then why my key is not working when other people compile my code?Stateless
Please include your code and we can take a look. I have proven to myself that it is possible to implement cryptographic functions across multiple technologies, c#, java, javascript which all converge to the same results. (Admittedly this was not SHA1, but the principle remains the same). There may be some bug, a missing reference, differing configurations, or some other anomaly to explain the differences you are seeing, but please post the code!Ancipital
E
5

They are asking for the SHA1 fingerprint on your keystore file (You sign your apps using this before you can push them to google play)

you can get your key by doing this

keytool -exportcert -alias your-key-name -keystore /path/to/your/keystore/file -list -v

you can use your keystore file from another computer just put it on a USB stick or email it to yourself (Make sure to keep it private !IMPORTANT!) and point your IDE to the file

Ellsworthellwood answered 5/9, 2014 at 11:48 Comment(1)
To use this command, remove the -exportcert parameter. The -list is what you're looking fore, and they are mutually exclusive. I'd suggest an edit, but SO says "edit queue is full" so guess someone already did.Hanky
U
4

SHA - stands for Secure Hash Algorithm.

SHA-1 is one of several cryptographic hash functions. SHA-1 is most often used to verify that a file has been unaltered. This is done by producing a hash value(hash value is produced by running an algorithm, called a cryptographic hash function), before the file has been transmitted, and then again once it reaches its destination. The transmitted file can be considered genuine only if both checksums are identical.

A file hashed with SHA1 could look like:

752c14ea195c369bac3c3b7896975ee9fd15eeb7

For detailed explanation you can refer to: https://www.lifewire.com/what-is-sha-1-2626011

Urbai answered 11/1, 2017 at 18:31 Comment(0)
V
3

If you are using Eclipse IDE, the easiest way to get the SHA1 fingerprint for your app:

  • click on your app project, in project explorer (on the left)
  • from the top menu, click Window -> Preferences
  • in the Preferences window, on the left, expand Android and click on Build

You should see the following information:

  • default debug keystore path
  • MD5 fingerprint
  • SHA1 fingerprint

You can also add other keystore file (for example, production keystore), and the values for that keystore will be shown also.

Vanir answered 5/9, 2014 at 11:54 Comment(4)
sir then why my key is not working when other people compile my code?Stateless
if you want other people to use same keystore when they sign the apk, try to read here #11446621.Vanir
but i want key only for debugging/building procesStateless
in your original question says google play api key. for other production keystore, see #19754022Vanir
H
1

The easiest way to get SHA 1 certficate fingerprint is to click on Gradle in the upper hand right side near the corner of the screen of Android Studio. Then click on the name of the app(e.g android123(root): it should appear like this). After that, you will find a subfolder named android and clicking on it go for the signingReport.It should run in the console and should show you the SHA 1 certficate fingerprint. Hope it helps.

Hushhush answered 12/4, 2019 at 15:50 Comment(0)
S
0

From a Windows command prompt, navigate to the root of the project. The gradlew file will be there.

type this at the prompt and (enter): gradlew signingReport

in the report look for something like: SHA1: A7:89:E5:05:C8:17:A1:22:EA:90:6E:A6:EA:A3:D4:8B:3A:30:AB:18

Sternforemost answered 22/9, 2020 at 21:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.