Given any groupand elementssuch that , the problem of solving foris known as the disctete log problem (DLP). In sage, this can be done for general groups by calling discrete_log
Typically, one considers the discrete log problem in , i.e. the multiplicative group of integers. Explicitly, the problem asks forgiven . This can be done by calling b.log(a)
in sage:
This section is devoted to helping the reader understand which functions are called when for this specific instance of DLP.
Whenis composite and not a prime power, discrete_log()
will be used, which uses generic algorithms to solve DLP (e.g. Pohlig-Hellman and baby-step giant-step).
When is a prime, Pari znlog
will be used, which uses a linear sieve index calculus method, suitable for .
When , SageMath will fall back on the generic implementation discrete_log()
which can be slow. However, Pari znlog
can handle this as well, again using the linear sieve index calculus method. To call this within SageMath we can use either of the following (the first option being a tiny bit faster than the second)
Given a small prime, we can compare the Pari method with the Sage defaults
We can also solve this problem with even larger primes in a very short time
// elliptic curve discrete log functions
// Visual
// Symmetries
// Permutations
Authors: Ariana, Zademn Reviewed by:
Modern cryptography is based on the assumption that some problems are hard (unfeasable to solve). Since the we do not have infinite computational power and storage we usually work with finite messages, keys and ciphertexts and we say they lay in some finite sets and .
Furthermore, to get a ciphertext we usually perform some operations with the message and the key.
For example in AES128 since the input, output and key spaces are 128 bits. We also have the encryption and decryption operations:
The study of sets, and different types of operations on them is the target of abstract algebra. In this chapter we will learn the underlying building blocks of cryptosystems and some of the hard problems that the cryptosystems are based on.
A setpaired with a binary operation is a group if the following requirements hold:
Closure: For all - Applying the operation keeps the element in the set
Associativity: For all
Identity: There exists an elementsuch that for all
Inverse: For all elements , there exists some such that . We usually denoteas
For , means when and when . For , .
If , then is commutative and the group is called abelian. We often denote the group operation by instead of and we typically use instead of .
Remark
The identity element of a group is also denoted with or just if only one groups is present
Examples of groups
Integers modulo (remainders) under modular addition . Let's look if the group axioms are satisfied
. Because of the modulo reduction
Modular addition is associative
is the identity element
we take to be the inverse of . We check that
Therefore we can conclude that the integers mod with the modular addition form a group.
Example of non-groups
is not a group because we can find the element that doesn't have an inverse for the identity . is not a group because we can find elements that don't have an inverse for the identity
Exercise
Is a group? If yes why? If not, are there values for that make it a group?
sɹosᴉʌᴉp uoɯɯoɔ puɐ sǝɯᴉɹd ʇnoqɐ ʞuᴉɥ┴ :ʇuᴉH
The identity of a group is unique
The inverse of every element is unique
. The inverse of the inverse of the element is the element itself
Proof:
In abstract algebra we have two notions of order: Group order and element order
Group order
The order of a group is the number of the elements in that group. Notation:
Element order
The order of an element is the smallest integer such that . If such a number doesn't exist we say the element has order . Notation:
We said our messages lay in some group . The order of this group is the number of possible messages that we can have. For we have possible messages.
Let be some message. The order of means how many different messages we can generate by applying the group operation on
Definition
Let be a group. We say is a subgroup of if is a subset of and forms a group. Notation:
Proprieties
The identity of is also in
The inverses of the elements in are found in
How to check ? Let's look at a 2 step test
Closed under operation:
Closed under inverses:
Let be a group,an element and . Consider the following set:
This set paired the group operation form a subgroup of generated by an element .
Why do we care about subgroups? We praise the fact that some problems are hard because the numbers we use are huge and exhaustive space searches are too hard in practice.
Suppose we have a big secret values space and we use an element to generate them.
If an elementwith a small order is used then it can generate only possible values and if is small enough an attacker can do a brute force attack.
Example
For now, trust us that if given a prime , a value and we compute for a secret , finding is a hard problem. We will tell you why a bit later.
// subgroups, quotient groups
// cyclic groups