I was going to encrypt with AES, But I noticed ECB mode is not safe for CPA. So I thought about preventing CPA by padding input text to a multiple of 16 bytes.
First, perform custom padding system: pad input text and secret text for 16bytes "each" like this, so input text will be a multiple of 16 bytes.
For example pad for 8 bytes, pad text is part of "12345678" in ASCII:
AAAAA -> AAAAA123
A -> A1234567
AAAAAAAA-> AAAAAAAA12345678
After that, pad with PKCS#7 compatible padding on this padded input + padded secret text.
Last, encrypt the padded text with AES128/ECB.
Then, secret text will be encrypted separately with input text. So.. maybe this prevents CPA.
I think it is not safe still on something other attack. But It seems like perfectly prevent to get secret text with CPA is.
Is there any way to get secret text? Or is it safe?
In other words, Is there any possible attack or CPA in other way on this upgraded ECB mode?