Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Tito781227
#78309 Hi,

My question might be dump, but i feel so frustrated for not finding a solution!, please help!

i found this code in Stackoverflow.com
https://stackoverflow.com/questions/453 ... ted-in-php

which uses crypto library in ESP8266

i did some search on google for the library i found the documentation!
https://nodemcu.readthedocs.io/en/maste ... es/crypto/

the problem is!, how to include the library in the code!, i mean it is built in in Arduino right?

i should write
#include <crypto.c>

but it is wrong, i tried several variations!, nothing worked !, my code is this:


#include <crypto.c>

void setup() {
Serial.begin(115200);
Serial.println("\nBooting...");

String key = "1234567812345678";

String data = "abc";

String b64enc = crypto.toBase64(crypto.encrypt("AES-CBC", key, data));

Serial.println(b64enc);
}

void loop() {
// put your main code here, to run repeatedly:

}


still gives error!
fatal error: crypto.c: No such file or directory

#include <crypto.c>

^

Anybody have ideas!, please help!
User avatar
By rudy
#78310
Tito781227 wrote:i found this code in Stackoverflow.com
https://stackoverflow.com/questions/453 ... ted-in-php

which uses crypto library in ESP8266

i did some search on google for the library i found the documentation!
https://nodemcu.readthedocs.io/en/maste ... es/crypto/

the problem is!, how to include the library in the code!, i mean it is built in in Arduino right?


That is not Arduino. That is Lua. Completely different.
User avatar
By Tito781227
#78313
rudy wrote:
Tito781227 wrote:i found this code in Stackoverflow.com
https://stackoverflow.com/questions/453 ... ted-in-php

which uses crypto library in ESP8266

i did some search on google for the library i found the documentation!
https://nodemcu.readthedocs.io/en/maste ... es/crypto/

the problem is!, how to include the library in the code!, i mean it is built in in Arduino right?


That is not Arduino. That is Lua. Completely different.


Omg!, i feel so stupid :S

Thank you very much :)