Hello world example of using the authenticated encryption with mbed TLS. The canonical source for this example lives at https://github.com/ARMmbed/mbed-os-example-tls
mbed TLS Benchmark example on mbed OS
This application performs authenticated encryption and authenticated decryption of a buffer. It serves as a tutorial for the basic authenticated encryption functions of mbed TLS.
Getting started
Building with mbed CLI
If you'd like to use mbed CLI to build this, then you should set up your environment if you have not done so already. For instructions, refer to the main readme. The instructions on this page relate to using the developer.mbed.org Online Compiler
Import the program in to the Online Compiler, select your board from the drop down in the top right hand corner and then compile the application. Once it has built, you can drag and drop the binary onto your device.
Monitoring the application
The output in the terminal window should be similar to this:
terminal output
plaintext message: 536f6d65207468696e67732061726520626574746572206c65667420756e7265616400 ciphertext: c57f7afb94f14c7977d785d08682a2596bd62ee9dcf216b8cccd997afee9b402f5de1739e8e6467aa363749ef39392e5c66622b01c7203ec0a3d14 decrypted: 536f6d65207468696e67732061726520626574746572206c65667420756e7265616400 DONE
Diff: mbedtls_entropy_config.h
- Revision:
- 5:97e046e0e2b1
- Child:
- 12:469204756969
diff -r 25b28db2388e -r 97e046e0e2b1 mbedtls_entropy_config.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbedtls_entropy_config.h Thu Aug 04 15:45:10 2016 +0100 @@ -0,0 +1,14 @@ +#if !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && !defined(MBEDTLS_ENTROPY_NV_SEED) + +#ifdef MBEDTLS_TEST_NULL_ENTROPY +#warning "MBED TLS SECURITY FEATURE IS DISABLED. THE TESTS WILL NOT BE SECURE! PLEASE IMPLEMENT HARDWARE ENTROPY FOR YOUR SELECTED HARDWARE." + +#else +#warning "THIS HARDWARE DOES NOT HAVE ENTROPY. DISABLING MBED TLS SECURITY FEATURE." +#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES +#define MBEDTLS_TEST_NULL_ENTROPY +#warning "MBED TLS SECURITY FEATURE IS DISABLED. THE TESTS WILL NOT BE SECURE! PLEASE IMPLEMENT HARDWARE ENTROPY FOR YOUR SELECTED HARDWARE." +#endif // defined(MBEDTLS_TEST_NULL_ENTROPY) + +#endif // !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && !defined(MBEDTLS_ENTROPY_NV_SEED) +