My first objective is to implement AES-GCM in PowerShell 5.1 since there is not an implementation that not use external dll libraries.
According to the GCM schema of encryption:
the E_k block should correspond to a 128-bit block and the input is encrypted by AES with a specific key K.
If at the beginning I want to focus only on the E_k block and I want to implement directly there the AES algorithm, is it correct saying that in that case no Block Cipher mode is applied because I'm focusing only on the block itself?
A further doubt: in the case of GCM, if each E_k takes as input 12 bytes IV +counter_value and each E_k block is sized 16 bytes (128 bits), the IV is padded with 0 (or another predefined value) for the next 4 bytes to reach 16 bytes of size? So for each block we have, for example, [BLOCK 0] 7808B1A23DDC2F9D90A4BCED00000000; [BLOCK 1] 7808B1A23DDC2F9D90A4BCED00000001; [BLOCK 2] 7808B1A23DDC2F9D90A4BCED00000002; and so on?
Could this answer be applied also in my case so:
- the "raw" AES could be applied by using ECB for the single E_k block?
- padding the plaintext (in our case the 12-byte IV) up to 16 bytes with 4 bytes of 0s?
I hope the information is clear.
Thank you