Skip to content

w4term3loon/crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Correlation Immunity Analyzer

This Lua script analyzes Boolean functions defined in hexadecimal format for their t-th order correlation immunity. Two algorithms are supported:

  • Naive (-n)
  • Optimized (-o)

Usage

lua analyzer.lua <hex-binary-function> <correlation-order> [-n | -o]

Parameters

  • <hex-binary-function>: Hexadecimal representation of the Boolean function's output.
  • <correlation-order>: The order t for correlation immunity.
  • -n: Use the naive algorithm.
  • -o: Use the optimized algorithm.

Examples

lua analyzer.lua 0xB4 1 -n
lua analyzer.lua 0xDB011464C2F090B41B597D60DD256EE2 2 -o

Sample Inputs

Name Hexadecimal Function
groundT 0xB4
7-bit 0xDB011464C2F090B41B597D60DD256EE2
8-bit 0xDB011464C2F090B41B597D60DD256EE224FEEB9B3D0F6F4BE4A6829F22DA911D
9-bit Concatenation of 7-bit and 8-bit values

Output

The analyzer reports:

  • Whether the function is balanced (equal number of 0s and 1s).
  • Whether it is immune to t-th order correlation.
  • Which algorithm was used.

Additional Functionality

The script also includes:

  • Hamming weight and Walsh transform utilities.
  • A simple Fermat primality test, included for experimentation.

This analyzer is a practical tool for testing correlation properties of Boolean functions in cryptographic contexts, such as S-box analysis or stream cipher component validation.

About

University course materials.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages