9 years, 9 months ago.

Is there any working example programs to encrypt a string??

It would really speed things up in our project...

Thanks

Question relating to:

2 Answers

9 years, 9 months ago.

Hi Lio. Have a look at: http://developer.mbed.org/forum/libdev/topic/5094/

That example uses I believe a forked version Of the Crypto library. That forum post also links to an example. Please be aware that the ciphers haven't been thoroughly tested. Also, don't use the ECB cipher. ECB isn't secure.

9 years, 9 months ago.

CyaSSL is a good library for Crypto, is free, and has support for many current methods in use.

Hi Elijah, I attempted to use CyaSSL, however, I had a heck of a time figuring out how to use the library. Do you have an example of how to use AES and HMAC?

posted by d 0773d 27 Feb 2015

On their website, reading through their manual documentation they have some examples and demonstrations for how to use their library. Here's the manual link to their CtaoCrypt page: http://wolfssl.com/yaSSL/Docs-cyassl-manual-10-ctaocrypt-usage-reference.html If you are looking for an example, pull down their library and import the <Cyassl_root>/ctaocrypt/test The "test" folder contains a .c and .h files, which when you compile your program, should run a simple test on the mbed board with test input into the hash compared to the hash output. It should be a simple step to mimic their test code from there inside your own program

posted by Elijah P 27 Feb 2015

Be aware that you need to #define some settings under settings.h (inside one of the folders). I know for sure that SIZEOF_LONG_LONG or SIZEOF_LONG need to be defined depending size of variables for your platform. More details on the settings are listed here: http://wolfssl.com/yaSSL/Docs-cyassl-manual-2-building-cyassl.html Specifically, look at the "non-standard" instructions, as those are universal to the code.

posted by Elijah P 27 Feb 2015