In this article, I will show you how to encrypt your sensitive data in your Flutter application using AES (Advanced encryption standard).
AES is based on a design principle known as a substitution–permutation network, and is efficient in both software and hardware. It is essential for government computer security, cybersecurity and electronic data protection.
Security experts maintain that AES is secure when implemented properly. However, AES encryption keys need to be protected. Even the most extensive cryptographic systems can be vulnerable if a hacker gains access to the encryption key.
How AES encryption works
Unlike its predecessor DES, AES does not use a Feistel network. AES is a variant of Rijndael, with a fixed block size of 128 bits, and a key size of 128, 192, or 256 bits.
AES includes three block ciphers:
AES-128 uses a 128-bit key length to encrypt and decrypt a block of messages, while AES-192 uses a 192-bit key length and AES-256 a 256-bit key length to encrypt and decrypt messages. Each cipher encrypts and decrypts data in blocks of 128 bits using cryptographic keys of 128, 192 and 256 bits, respectively.
The ciphers use the same key for encrypting and decrypting, so the sender and receiver must both know and use the same secret key.
Described above types use different rounds in the process. A round consists of several processing steps that include substitution, transportation, and mixing of the input plain text to transform it into the final output of cipher text.
· 128 bit keys -> 10 rounds
· 192 bit keys -> 12 rounds
· 256 bit keys -> 14 rounds
There are 10 rounds for 128-bit keys, 12 rounds for 192-bit keys and 14 rounds for 256-bit keys. A round consists of several processing steps that include substitution, transposition and mixing of the input plaintext to transform it into the final output of ciphertext.