I was wondering where did affine cipher get its name from. I am curious to know its origin and how it is related to the cipher. The Affine Transformation page on Wikipedia states:

In Euclidean geometry, an affine transformation, or an affinity (from the Latin, affinis, "connected with"), is a geometric transformation that preserves lines and parallelism (but not necessarily distances and angles).

I assume this definition is related to affine cipher since it is a linear transformation at the end of the day. Is this the reason why it got its name?

It would be appreciated if someone provides a bit of history behind the name.

  • 3
    $\begingroup$ Does this answer your question? Have affine ciphers actually been used in practice? This answer includes a historical search, too. If anyone has better history/backgorund information let us hear that. $\endgroup$
    – kelalaka
    Commented Feb 5, 2022 at 19:47
  • 1
    $\begingroup$ To some extent it does. Here is what I gathered from that answer in summary: affine cipher mainly has had educational purposes for the most part and it is a term that was coined for the first time in 1983 (at least according to this specific answer). This answer does not clarify why the term "affine" was used in the name. I have some guesses as to why but I would like to solidify my guess. It would be great if someone could explain why the term affine is used. $\endgroup$
    – Josh
    Commented Feb 5, 2022 at 20:39
  • $\begingroup$ For example, by combining translations and linear transformations we obtain an affine cipher: $\endgroup$
    – kelalaka
    Commented Feb 5, 2022 at 23:59

1 Answer 1


In mathematics (specifically in linear algebra) an affine transformation is a combination of a linear transformation and a translation, i.e. a map of the form: $$x \mapsto ax + b$$ where $a$ and $b$ are constants independent of $x$.*

This is exactly the form that the encryption operation in an affine cipher takes, and presumably where the name comes from.

Indeed, as I note in my earlier answer, this is the explanation given by Douglas R. Stinson in his 1995 book Cryptography: Theory and Practice, which contains the earliest description of the affine cipher in its "modern" educational form that I'm aware of (emphasis original):

In the Affine Cipher, we restrict the encryption functions to functions of the form $$e(x) = ax + b \bmod 26,$$ $a, b \in \mathbb Z_{26}$. These functions are called affine functions, hence the name Affine Cipher.

(FWIW, the terms "function", "map" and "transformation" are used more or less interchangeably in linear algebra. They may imply a slightly different perspective, but in the end, every transformation is a map and can be represented as a function.)

*) The types of the constants $a$ and $b$ and the argument $x$ depend on the space the transformation is defined on. Typically, for an affine transformation of vectors from $\mathbb R^m$ to $\mathbb R^n$, $x$ would be an $m$-element vector, $a$ would be an $n \times m$ matrix, and $b$ would be an $n$-element vector. But the general concept of an affine transformation can also apply to other kinds of mathematical objects. For example, affine cipher encryption can be seen as an affine transformation on the set of integers modulo $n$ (where $n$ is the cipher alphabet size), regarded as a module (a generalization of a vector space) over the integers (or even over itself).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.