INNER CODE UNIT · Python

rand_const

KnifeXRage/Godot-Secure · Godot Secure Scripts/universal/Godot Secure AES-256 Universal v6.py:81

    def rand_const():
        return secrets.randbelow(255) + 1  # never zero

    layers = secrets.randbelow(5) + 2

    a = secrets.choice(operands)
    b = operands[1] if a == operands[0] else operands[0]
    shift, rshift = rotation()

    expression = secrets.choice(base_ops).format(a=a,b=b,shift=shift,rshift=rshift,const=rand_const())

    for _ in range(layers - 1):
        shift, rshift = rotation()
        value = secrets.choice(operands)

        # never allow identical cancellation
        if value == expression:
            value = secrets.choice(operands)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…