SHA256 encryption example?

zliudr
Posts: 360
Joined: Thu Oct 03, 2019 5:15 am

SHA256 encryption example?

Postby zliudr » Tue Jan 07, 2020 5:03 am

I'm searching for example code for SHA256 but found some highly "cryptic" unit test code for it, nothing useful. Any direction to a simple encryption code is appreciated!

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

Re: SHA256 encryption example?

Postby ESP_Sprite » Tue Jan 07, 2020 8:35 am

Erm, you are aware that SHA256 is an hashing algorithm, not an encryption algorithm? If you can find a way to 'decrypt' SHA, there's probably a dozen nobel prizes waiting for you :P Aside from that, what examples specifically are you looking for? There's the 'raw' hardware interfaces, but you may be better off using the esp-idf mbedtls or libsodium components; it should be easy to find examples for that.

zliudr
Posts: 360
Joined: Thu Oct 03, 2019 5:15 am

Re: SHA256 encryption example?

Postby zliudr » Wed Jan 08, 2020 8:24 pm

Since posting this thread I've come across both terms mbedtls and libsodium. I've not found examples included in esp-idf for mbedtls hmac sha256 though. It's unfortunate. Any link to an actual example in esp-idf? I had to use an online tutorial for esp-arduino and piece together my understanding by reading sha256.h and md.h. It's not supposed to be like this.

https://techtutorialsx.com/2018/01/25/e ... mechanism/

I would like to see a standard example from the source, not someone else who may or may not know all the tricks one has to do to make the library work correctly.

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: SHA256 encryption example?

Postby chegewara » Wed Jan 08, 2020 11:03 pm

zliudr wrote: I would like to see a standard example from the source, not someone else who may or may not know all the tricks one has to do to make the library work correctly.
If you want standard examples from source then you are looking in wrong place. mbedtls is 3rd party library, so you should look at mbedtls.
https://tls.mbed.org/

zliudr
Posts: 360
Joined: Thu Oct 03, 2019 5:15 am

Re: SHA256 encryption example?

Postby zliudr » Thu Jan 09, 2020 3:18 am

chegewara wrote:
Wed Jan 08, 2020 11:03 pm
zliudr wrote: I would like to see a standard example from the source, not someone else who may or may not know all the tricks one has to do to make the library work correctly.
If you want standard examples from source then you are looking in wrong place. mbedtls is 3rd party library, so you should look at mbedtls.
https://tls.mbed.org/
Bookmarked. Thank you!

Who is online

Users browsing this forum: No registered users and 67 guests