AES CBC - what kind of padding?


#1

For compliance reasons we are obliged to use either ISO-, CMS- or ESP-padding when using block ciphers. I’m afraid I couldn’t find any information regarding this topic neither on the website nor on Github.

What kind of padding is SQL Cipher using in a standard configuration using AES CBC?


#2

Hello @froitag

SQLCipher does not use padding when encrypting the data. SQLCipher encrypts data based on the cipher_page_size, which defaults to 1024 bytes. The page size must be a multiple of the block size used by AES (i.e., 128 bits).


#3

Padding is not necessary because the size of the encrypted pages is chosen such that it fits (a multiple of) the cipher’s block size. Got it!

Thanks @developernotes!