Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is use sha1 sign to verify a parameter in the request safe? #77

Closed
Y2Nk4 opened this issue Jul 24, 2017 · 2 comments
Closed

Is use sha1 sign to verify a parameter in the request safe? #77

Y2Nk4 opened this issue Jul 24, 2017 · 2 comments
Labels

Comments

@Y2Nk4
Copy link

Y2Nk4 commented Jul 24, 2017

I have a project that our API should verify a parameter which is about the trade.
We use a method like the demo.
Demo
Request:
Host:192.168.0.1
parameters: sign - To verify the parameter
tradeinfo
sign = sha1(secretKey + tradeinfo + secretKey);

@Y2Nk4 Y2Nk4 closed this as completed Aug 12, 2017
@Maikuolan
Copy link
Collaborator

Hi SakuraLove,

I just noticed your issue was closed without any responses. Sorry to see that there weren't any responses at an earlier time (I'd assumed that someone would've piped in).

I guess the issue is either resolved or not important now, seeing as the issue has been closed, but I'll try to answer anyhow.

It's difficult to say exactly whether using SHA1 for your API will be safe or unsafe, without knowing the exact context of its use, how it's being used and so on. Generally though, compared to other, newer hashing algorithms, SHA1 isn't considered safe anymore, due to that it has recently left the club of hashing algorithms without known collisions and entered the club of hashing algorithms with known collisions (so, officially unsafe, in that regard). It's possible that your own implementation won't run into any specific security problems, but seeing as it's now officially unsafe, I can't say with any certainty that any unknown implementation of it would be safe.

Also see:

@Y2Nk4
Copy link
Author

Y2Nk4 commented Aug 12, 2017

Thank you anyway.I notice that nobody answered this issue so I closed it .
Yes,It has never been safe.I noticed that Google's team has cracked the SHA-1 Function some months ago.
I will also try to use the newer hasing and encrypt the trade info by AES.
And the API is using HTTPS to send information , too.
Our team is also discussing the security.And my project met a big problem now :(
However,thank you very much for answering me.Have a nice day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants