How to use AES - the Advanced Encryption Standard

by Peter_vdL Motorola on 04-23-2012 04:30 PM - last edited on 04-25-2012 10:01 AM by Community Manager

As we see increased use of Android in the Enterprise world, there is increased interest in the use of encryption for data security.   Encryption has been practised for at least 2000 years to keep messages secret.  One of the first ciphers shifted letters in a message, to the letter that was N places away from it in the alphabet.  The key was the value of N.  This cipher was used by Julius Caesar (the famous Caesar who conquered Gaul - all 3 parts - and invaded Britain twice in 55 and 54 BCE).  Caesar's name stuck to the cipher he used.


Today, we have much stronger ciphers, including ciphers that have been proved to be computationally infeasible to penetrate.  That's the technical term for "trying every possible key to see which one decrypts the message will take far, far too long to be practical".  The current "gold standard" for encryption is the Advanced Encryption Standard or AES, which was adopted as a US Federal standard in 2001.

Screen Shot 2012-04-19 at 10.03.10 AM.png


Figure 1: Sample code demonstrating use of AES encryption from the MOTODEV technical library


AES has gone on to enjoy widespread use around the world among organizations that are concerned with data security.  You can protect your own data with AES, too.  There is a full implementation of AES for encryption and decryption on every Android mobile device.  What has been missing up to now is a good complete tutorial on using AES on Android.  Software developers haven't had a freely-available guide to the use of AES, along with a description of why code is written that way.


That's why I am happy to announce the availability of a new article in the MOTODEV Technical Library - "Using the Advanced Encryption Standard in Android".   Encryption is a weighty topic, so it's a somewhat lengthy article.  But the article breaks down the material and addresses all the obscure areas with meaningful explanations (not mathematical jargon).  The article gives you all the information you need to use AES successfully with your own apps and and data.  There's also the source code for an accompanying demo app, called AESdemo, that shows the complete process of generating a 256 bit random secret key, and using it to encrypt then decrypt a message (or any data) that you want to keep confidential.


Encryption is not a trivial topic to master.  These MOTODEV resources will give you the information you want, to get the data security you need.


Peter van der Linden

Android Technology Evangelist

Post a Comment
Be sure to enter a unique name. You can't reuse a name that's already in use.
Be sure to enter a unique email address. You can't reuse an email address that's already in use.
reCAPTCHA challenge image
Type the characters you see in the picture above.Type the words you hear.
MOTODEV for Enterprise

Comment on our blog and tell us how we can help you build and distribute enterprise mobile applications on Motorola devices.

Subscribe to our RSS feed Subscribe via RSS

Follow Us

Our Blog & Comment Policy
Opinions expressed here and in any corresponding comments are the personal opinions of the original authors, not of Motorola. The content is provided for informational purposes only and is not meant to be an endorsement or representation by Motorola or any other party.

Remember, when you comment, please stay on topic and avoid spam, profanity, and anything else that violates our user guidelines. All comments require approval by Motorola and can be rejected for any reason.

For customer support issues with your Motorola phone go to the Motorola customer support website.