Sitemap
Press enter or click to view image in full size

Member-only story

Crypto Sometimes Likes Zero: Meet Non-adjacent Form

4 min readApr 10, 2024

--

Here is a bit of trivia for you … why do we use 65,537 as the encryption exponent value for RSA?

Well, 65,537 is a prime number as the encryption exponent cannot share a factor with (p-1)(q-1). Also, in its binary representation of “10000000000000001”, we can see that it has many zeros and only two 1’s. Why is this good? Well, when we perform an operation of:

M^e (mod p)

it is more efficient to process with a zero in the exponent (e) value, than with a 1.

CSD

With the Canonic Signed Digit (CSD) Representation of Integers, we can represent we can represent an integer (n) in the form:

and where we get:

and where L_n can be positive and negative integers. In normal binary, a value of 11 would be:

This could be represented in a CSD form as:

and which is [1 0 -1 0 -1].

Let’s say we have a value of 48,153, and want four values. These could be {(3,-3}), (-7,7),(-1, 1)}, and could represent as:

and repsented as:

[3 0 0 0 -1 0 0 0 0 1 0 0 0 0 -7]

NAF has the advantage that the Hamming weight between values is minimal, and where in a normal binary format, we…

--

--

Prof Bill Buchanan OBE FRSE
Prof Bill Buchanan OBE FRSE

Written by Prof Bill Buchanan OBE FRSE

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.