AES plaintext is smaller than 128 bits I'm currently developing a AES implementation in a graduation project at university.
As far as I know, AES uses a 128 bit block length as input .
if the entered string to encrypt is not 128 bits such as 32 bits .
what should be done for data that is less than 128 bits ? What's the best solution ?
It really depends on the block mode that you are going to use. If you want to use something like CBC, have a look into PKCS#7. If you were to use CTR mode, then you do not require any padding, as the input will always be in chunks of 16 bytes, and you use as much of it as you require.