Waspmote Libraries; Waspmote Rsa Files; Constructor; Pre-Defined Constants - Libelium Waspmote v15 and Plug & Sense Programming Manual

Waspmote encryption libraries
Table of Contents

Advertisement

RSA Signature scheme: Encrypting with the private key, and then decrypting with the public key.
Encryption rule: F (m,d) = m
-
Decrypti on rule: F (s,e) = s
-
-
Where 'm' is the message, 'e' is the public exponent, 'd' is the private exponent and 'c' is the ciphertext.
RSA is slower than certain other symmetric cryptosystems. RSA is, in fact, commonly used to securely transmit the keys for
another less secure, but faster algorithm.

3.1. Waspmote Libraries

3.1.1. Waspmote RSA Files

WaspRSA.h is the header file of the class, and WaspRSA.cpp is the class where the functions and variables are implemented.
It is mandatory to include the RSA library when using it. The following line must be introduced at the beginning of the code:
#include <WaspRSA.h>

3.1.2. Constructor

To start using Waspmote RSA library, an object from class 'WaspRSA' must be created. This object, called 'RSA' , is created inside
the Waspmote RSA library and it is public to all libraries. It is used through the guide to show how the Waspmote RSA library
works.
When creating this constructor, no variables are initialized by default.

3.1.3. Pre-Defined Constants

There are some constants defined in 'WaspRSA .h' related with the different encryption and padding modes that can be used to
encrypt messages.

3.2. Encrypting Message

The function
RSA.encrypt()
modulus 'n' . Receiver can decrypt the message using the private key.
{
RSA.encrypt(
}
Note: The maximum input size message must be smaller than the modulus.
Example of use:
http://www.libelium.com/development/waspmote/examples/rsa-01-encryption
d
mod n = s
e
mod n = m
encrypts an original message to an encrypted message using the public exponent 'e' and the
original_message,
public_exponent,
modulus,
encrypted_message,
sizeof(encrypted_message));
-10-
Authenticity
v7.0

Advertisement

Table of Contents
loading

Table of Contents