General This is a tool for generating and analyzing 8-bit substitution boxes.
Nyberg Sbox
  1. Affine transformation
    x' = (x × 16 mod 10116) ⊕ 16
  2. Galois Field inversion
    Using field ,
    x'' = x'-1       if x' ≠ 0
          0         if x' = 0
  3. Affine transformation
    x''' = (x'' × 16 mod 10116) ⊕ 16
Custom Sbox Available functions:
aes_sbox(input)
aes_inv_sbox(input)
rotl(byte, shift) // rotate left
affine(x, multiplier, adder)
gf_mul(x, y, polynomial = 0x11B)
gf_inv(x, polynomial = 0x11B)
xgcd(x, modulus = 257)
let sbox = new Uint8Array(256) // You should populate this array.

Output
+ 0001020304050607 08090A0B0C0D0E0F
Show analysis:
This tool is only made for educational purposes and is not meant to be used in serious cryptographic applications. Made by @CharCoding.
References:
  1. Nyberg K. (1991) Perfect nonlinear S-boxes. In: Davies D.W. (eds) Advances in Cryptology — EUROCRYPT ’91. EUROCRYPT 1991. Lecture Notes in Computer Science, vol 547. Springer, Berlin, Heidelberg
  2. "The Advanced Encryption Standard" (PDF). FIPS PUB 197: the official AES standard. Federal Information Processing Standard. 2001-11-26.
  3. Jie Cui; Liusheng Huang; Hong Zhong; Chinchen Chang; Wei Yang (May 2011) "AN IMPROVED AES S-BOX AND ITS PERFORMANCE ANALYSIS" (PDF).