Enter a single character to see its exact step-by-step manual derivation
Manual Calculation Mode: Rather than processing 16 bytes at once, this guide focuses on 1 character (8 bits) so you can follow along on paper and present it in your viva!
Character 'H'
ASCII: 72 | Hex: 0x48 | Binary: 01001000
1 Character โ 8 Bits
๐ข Step 2: Convert Character to 8-Bit Binary
Character ASCII Code โ 8-bit binary vector (P[7] to P[0])
For character 'H': ASCII code = 72 (Hex: 0x48). Converting to 8-bit binary yields 01001000.
Bit Index
P[7] (MSB)
P[6]
P[5]
P[4]
P[3]
P[2]
P[1]
P[0] (LSB)
๐ Step 3: Extract Tap Values from Initial Seeds (L & N)
Read required bit indices from 128-bit LFSR (L) and NFSR (N) registers
Grain-128 specifies exact tap positions in the registers. Look up these bit indices in initial seed L = 0xACE1... and N = 0x1234...:
Apply exact same keystream to recover original character
XOR is self-inverse: (P โ Z) โ Z = P. XORing Ciphertext C with Keystream Z recovers Plaintext P!
Bit Position
Ciphertext Bit (C)
Keystream Bit (Z)
XOR Calculation
Recovered Bit (P)
โ
Decryption Successful!
Recovered Plaintext Byte: 0x48 (01001000)
'H'
๐ Official Grain-128 Standard Fixed Tap Specification Table
Fixed Architecture Notice: These bit tap indices are defined by the Grain-128 cryptographic standard (ECRYPT Stream Cipher Project). In your NanGate 45nm ASIC hardware RTL, these indices are physical copper wires connected directly to the combinational AND/XOR logic gates. They are 100% fixed and do not change.