Random numo Galois Field
Polynomial Arithmetic
Example of Polynomial Arithmetic
bers, its types and usage.
TRNG, PRNG, CHPRNG
Review of BBS
Stream Ciphering
RC4 algorithm
Basic Number Theory
Extended Euclidean Algorithm
Relevance of Extended Euclidean Algorithm
Computers and Programming , Programming Languages Types, Problem solving, Introduction to the MATLAB environment, Using MATLAB Documentation
Introduction to the course, Operating methodology-Installation Procedure
1. Compare a sample code in C with MATLAB
2. Trajectory of a particle in projectile motion ( solving quadratic equations)
3. Ideal gas law problem to find volume
RSA and OAEP
Diffe-Hellman Key Exchange and its Security Aspects
Model of Asymmetric Key Cryptography
Factorization and other methods for Public Key Cryptography
1 Planning the Computer Program
2 Uses of Algorithm
3 Flow Charts
4 Pseudo code Applications: To produce an ordered sequence of steps, that describe solution of a problem.
1.History of C Language, Structure of a C program, Statements, Basic Data Types, Variables &Constants, Input & Output statements, Operators and Precedence, Expressions, Simple C programs.
Computers and Programming , Programming Languages Types, Problem solving, Introduction to the MATLAB environment, Using MATLAB Documentation
Introduction to the course, Operating methodology-Installation Procedure
1. Compare a sample code in C with MATLAB
2. Trajectory of a particle in projectile motion ( solving quadratic equations)
3. Ideal gas law problem to find volume
RSA and OAEP
Diffe-Hellman Key Exchange and its Security Aspects
Model of Asymmetric Key Cryptography
Factorization and other methods for Public Key Cryptography
1 Planning the Computer Program
2 Uses of Algorithm
3 Flow Charts
4 Pseudo code Applications: To produce an ordered sequence of steps, that describe solution of a problem.
1.History of C Language, Structure of a C program, Statements, Basic Data Types, Variables &Constants, Input & Output statements, Operators and Precedence, Expressions, Simple C programs.
Introduction
Plotting basic 2-D plots.
The plot command
The fplot command
Plotting multiple graphs in the same plot
Formatting plots
USING THE plot() COMMAND TO PLOT
MULTIPLE GRAPHS IN THE SAME PLOT
MATLAB PROGRAM TO PLOT VI CHARACTERISTICS OF A DIODE
SUMMARY
INTRODUCTION
Relational Query Languages
Formal Query Languages
Introduction to relational algebra
Set Operators Join operator
Aggregate functions, Grouping
Relational Calculus concepts
Introduction to Structured Query Language (SQL)
Features of SQL, DDL Statements
This topic-based on Compiler Design Subject, III B.Tech-CSE Students, Intermediate Code Generation is the 3rd module of compiler design subject, these topics totally related to the second subjective assignment of Academic Writing in Swayam online course.
A Primality test is an algorithm for determining whether an input number is Prime. Among other fields of mathematics, it is used for Cryptography. Factorization is thought to be a computationally difficult problem, whereas primality testing is comparatively easy (its running time is polynomial in the size of the input).
In this chapter we are going to get familiar with recursion and its applications. Recursion represents a powerful programming technique in which a method makes a call to itself from within its own method body. By means of recursion we can solve complicated combinatorial problems, in which we can easily exhaust different combinatorial configurations, e.g. generating permutations and variations and simulating nested loops. We are going to demonstrate many examples of correct and incorrect usage of recursion and convince you how useful it can be.
A presentation on Intermediate Code generation in Compiler System. Provides introduction, types of intermediate code representation and commonly used intermediate code representation.
Introduction
Plotting basic 2-D plots.
The plot command
The fplot command
Plotting multiple graphs in the same plot
Formatting plots
USING THE plot() COMMAND TO PLOT
MULTIPLE GRAPHS IN THE SAME PLOT
MATLAB PROGRAM TO PLOT VI CHARACTERISTICS OF A DIODE
SUMMARY
INTRODUCTION
Relational Query Languages
Formal Query Languages
Introduction to relational algebra
Set Operators Join operator
Aggregate functions, Grouping
Relational Calculus concepts
Introduction to Structured Query Language (SQL)
Features of SQL, DDL Statements
This topic-based on Compiler Design Subject, III B.Tech-CSE Students, Intermediate Code Generation is the 3rd module of compiler design subject, these topics totally related to the second subjective assignment of Academic Writing in Swayam online course.
A Primality test is an algorithm for determining whether an input number is Prime. Among other fields of mathematics, it is used for Cryptography. Factorization is thought to be a computationally difficult problem, whereas primality testing is comparatively easy (its running time is polynomial in the size of the input).
In this chapter we are going to get familiar with recursion and its applications. Recursion represents a powerful programming technique in which a method makes a call to itself from within its own method body. By means of recursion we can solve complicated combinatorial problems, in which we can easily exhaust different combinatorial configurations, e.g. generating permutations and variations and simulating nested loops. We are going to demonstrate many examples of correct and incorrect usage of recursion and convince you how useful it can be.
A presentation on Intermediate Code generation in Compiler System. Provides introduction, types of intermediate code representation and commonly used intermediate code representation.
Justification of Montgomery Modular Reductionacijjournal
one of the most known and widely used methods in Cryptography is the method suggested by Peter
Montgomery; this method is based on the changing of the original reduction modulo by some other
convenient modulo, the original Montgomery paper gives the algorithm without any considerations
leading to that algorithm.
A study on number theory and its applicationsItishree Dash
A STUDY ON NUMBER THEORY AND ITS APPLICATIONS
Applications
Modular Arithmetic
Congruence and Pseudorandom Number
Congruence and CRT(Chinese Remainder Theorem)
Congruence and Cryptography
Backtracking based integer factorisation, primality testing and square root c...csandit
Breaking a big integer into two factors is a famous problem in the field of Mathematics and
Cryptography for years. Many crypto-systems use such a big number as their key or part of a
key with the assumption - it is too big that the fastest factorisation algorithms running on the
fastest computers would take impractically long period of time to factorise. Hence, many efforts
have been provided to break those crypto-systems by finding two factors of an integer for
decades. In this paper, a new factorisation technique is proposed which is based on the concept
of backtracking. Binary bit by bit operations are performed to find two factors of a given
integer. This proposed solution can be applied in computing square root, primality test, finding
prime factors of integer numbers etc. If the proposed solution is proven to be efficient enough, it
may break the security of many crypto-systems. Implementation and performance comparison of
the technique is kept for future research.
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docxmydrynan
CSCI 2033: Elementary Computational Linear Algebra
(Spring 2020)
Assignment 1 (100 points)
Due date: February 21st, 2019 11:59pm
In this assignment, you will implement Matlab functions to perform row
operations, compute the RREF of a matrix, and use it to solve a real-world
problem that involves linear algebra, namely GPS localization.
For each function that you are asked to implement, you will need to complete
the corresponding .m file with the same name that is already provided to you in
the zip file. In the end, you will zip up all your complete .m files and upload the
zip file to the assignment submission page on Gradescope.
In this and future assignments, you may not use any of Matlab’s built-in
linear algebra functionality like rref, inv, or the linear solve function A\b,
except where explicitly permitted. However, you may use the high-level array
manipulation syntax like A(i,:) and [A,B]. See “Accessing Multiple Elements”
and “Concatenating Matrices” in the Matlab documentation for more informa-
tion. However, you are allowed to call a function you have implemented in this
assignment to use in the implementation of other functions for this assignment.
Note on plagiarism A submission with any indication of plagiarism will be
directly reported to University. Copying others’ solutions or letting another
person copy your solutions will be penalized equally. Protect your code!
1 Submission Guidelines
You will submit a zip file that contains the following .m files to Gradescope.
Your filename must be in this format: Firstname Lastname ID hw1 sol.zip
(please replace the name and ID accordingly). Failing to do so may result in
points lost.
• interchange.m
• scaling.m
• replacement.m
• my_rref.m
• gps2d.m
• gps3d.m
• solve.m
1
Ricardo
Ricardo
Ricardo
Ricardo
�
The code should be stand-alone. No credit will be given if the function does not
comply with the expected input and output.
Late submission policy: 25% o↵ up to 24 hours late; 50% o↵ up to 48 hours late;
No point for more than 48 hours late.
2 Elementary row operations (30 points)
As this may be your first experience with serious programming in Matlab,
we will ease into it by first writing some simple functions that perform the
elementary row operations on a matrix: interchange, scaling, and replacement.
In this exercise, complete the following files:
function B = interchange(A, i, j)
Input: a rectangular matrix A and two integers i and j.
Output: the matrix resulting from swapping rows i and j, i.e. performing the
row operation Ri $ Rj .
function B = scaling(A, i, s)
Input: a rectangular matrix A, an integer i, and a scalar s.
Output: the matrix resulting from multiplying all entries in row i by s, i.e. per-
forming the row operation Ri sRi.
function B = replacement(A, i, j, s)
Input: a rectangular matrix A, two integers i and j, and a scalar s.
Output: the matrix resulting from adding s times row j to row i, i.e. performing
the row operatio.
INTRODUCTION
3NF and BCNF
Decomposition requirements
Lossless join decomposition
Dependency preserving decomposition
Disk pack features
Records and Files
Ordered and Unordered files
2NF,NF,3NF,BCNF
Database Systems
DBMS
Database System Environment
Traditional File Systems
Advantages of DBMS over File Systems
Disadvantages of DBMS
DBMS
Describing and Storing data in DBMS
Three Schema Architecture
Data Independence
Queries
Transactions
Structure of DBMS
Users of DBMS
Steps in database Design Process
ER Concepts and Notations
Class Hierarchies
Memory Hierarchy
RAM
Memory Chip Organization
ROM
Flash Memory
Types of Programming Languages
Compiler vs Interpreter vs Assembler
Types of programming languages
Compiler vs interpreter vs assembler
high level language vs assembly level language vs low level language
1.1Explain types of Input Devices (Keyboard, Mouse, Pen, and Touch Screen Scanners, Output Devices (Monitor, printer, Speakers, Projectors) and of Storage Devices (Hard Disks, CD-ROMS, DVD-ROMS, USB Storage)[D] Operate computer and its peripherals
1.2 Booting the computer. Common start-up errors and their remedies.
Connecting peripherals – keyboard, mouse, monitor, power cables,
UPS to the computer and checking all connections. Demonstrate procedure for the installation of setting up a new computer along with other peripherals (keyboard, scanner, printer)[M]
1.3Demonstrate Keyboard layout and functions of different keys.[M]
1.4Demonstrate Proper shut down of PC, and explain precautions to avoid an improper shut down.[M]
1.5Identifying the different hardware parts in the PC.[M]
1.6Determining the configuration of the PC.[M]
1.7 Explain types of Central Processing Unit (Processors, RAM, ROM)[M]
1.8 Demonstrate procedure for installation /
replacement / maintenance procedures for hard disk and other peripherals.[D]
Arrays
Array Creation , Accessing Elements
Sub Arrays, Representation, Operations
Maximum and Minimum values in Matrix
Potential Energy-Spring Problem
SUMMARY
An introduction to AI,ML,DL
Working of AI System
Scope of AI ,Cyber Security and BCT in Marine
Marine Education Scope of AI and BCT
Changes Required in Curriculum
Cyber security in Marine field
Parametric Analysis
Skill Set Requirement
Introduction
Overview of Loop statement
For loop
While loop
Nested loop
While loop vs for loop
prime number using matlab
armstrong number using matlab
special number using matlab
magic number using matlab
perfect number using matlab
pattern display number using matlab
palindrome number using matlab
fibonnacci series using matlab
MS word complete tutorials,Topics to be covered :
1. Create and save documentation.
2. Open, find, and rename files and folders.
3. Use “Formatting Toolbar”.
4. Use spelling and grammar checks in the document.
5. Use “Headers and Footers”.
6. Insert symbols and pictures.
7. Create tables in MS-Word.
8. Use formulas in MS –WORD Mail merge, Embedding Excel to WORD. Applications : To create a professional grade document.
Guidelines for ER to Relational Mapping.
Mapping rules/ guidelines for mapping various ER constructs to Relational model with appropriate examples
Relational Query Languages Formal Query Languages
Introduction to Relational Algebra
Relational operators
Set operators
Join operators
Aggregate functions.
Grouping operator
Relational Calculus concepts
Relational algebra queries for data retrieval with sample relational schemas. relational algebra operations.
What is Relational model
Characteristics
Relational constraints
Representation of schemas
characteristics and Constraints of Relational model with proper examples.
Updates and dealing with constraint violations in Relational model
Steps in Database Design Process
ER Concepts (Entities, Attributes, Associations, etc)
ER Notations
Class Hierarchies
ER concepts, notations with appropriate examples. how to model databases using ER techniques.
advantages of using DBMS over traditional file systems; Three schema architecture; Data independence; DBMS architecture. FILE SYSTEM VS DBMS/RDBMS
THREE SCHEMA ARCHITECURE OF DBMS
DATA INDEPENDANCE
DBMS ARCHITECTURE
Learning to write programs using selection
Condition: Relational and Logical Expressions , Conditional Statements (if statement) , Choosing from Multiple Alternatives
Exercises in writing conditions using relational, logical operations, writing programs involving if statement, if-else, if- elseif and switch case statements in MATLAB
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Water scarcity is the lack of fresh water resources to meet the standard water demand. There are two type of water scarcity. One is physical. The other is economic water scarcity.
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
5. 5
Random Number and its Types
True Random number generator
Pseudo Random number generator
Case Study: Linux Random Number Generator
Feedback shift registers.
Lagged Fibonacci generator.
Linear congruential generator.
Case Study: RSA Key Generation
Nuclear decay
6. 6
A sequence of random numbers R1, R2, …, must have two important
statistical properties:
Uniformity
Independence.
Random Number, Ri, must be independently drawn from a uniform
distribution with pdf: pdf for random
numbers
otherwise,0
10,1
)(
x
xf
2
1
2
)(
1
0
21
0
x
xdxRE
12
1
4
1
3
1
2
1
3
)(
21
0
3
21
0
2
x
REdxxRV
Properties of Random Numbers
7. 7
Uniformity: If the interval [0,1] is divided into n
classes, or subintervals of equal length, the expected
number of observations in each interval is N/n, where
N is the total number of observations
Independence: The probability of observing a value in
a particular interval is independent of the previous
value drawn
Properties of Random Numbers
34. 34
Sources
The Basics of Abstract Algebra, Paul E. Bland, Freeman
Introduction to Cryptography with Java Applets, David Bishop, Jones
& Bartlett
Practical Cryptography, Niels Ferguson and Bruce Schneier, Wiley
Concrete Mathematics, Graham, Knuth, and Patashnik, Addison-
Wesley
Network Security: Private Communications in a Public World, Second
Edition Charlie Kaufman, Radia Perlman, Mike Speciner, Prentice-Hall
Applied Cryptography: Protocols, Algorithms and Source Code in C,
Second Edition, Bruce Schneier, Wiley
Cryptography and Network Security: Principles and Practices, William
Stallings, Prentice-Hall
and a number of web sites...
Basic Number Theory
35. 35
NUMBERS
PRIME NUMBRE
COMPOSITE NUMBER
EVEN NUMBER ODD NUMBER
SPECIAL NUMBER
ADAM NUMBER
N NARCISTIC NUMBER
MAGIC NUMBER
PERFECT NUMBER
Basic Number Theory
Program
implementation
demo to be shown
Calculating GCD
36. 36
NUMBERS
PRIME NUMBRE :
Any number having only two factors is PRIME
Any number is either a prime or product of prime
Basic Number Theory
39. Extended Euclid Algorithm
Given K=20, in Domain=73
K-1 = ?????
GCD(20,73)=1 then and only then multiplicative inverse of k is possible
To calculate t=t1-(q*t2)
K-1 for K=20 thin the domain 73 is 11
q r1 r2 r
3 73 20 13
1 20 13 7
1 13 7 6
1 7 6 1
6 6 1 0
1 0
t1 t1 t
0 1 -3
1 -3 4
-3 4 -7
4 -7 11
-7 11 -73
11 -73
40. 40
Modular Arithmetic is one of the main tools provided
by number theory
The quotient of n divided by m is , where m and n are
positive integers
The remainder of this division is called 'n mod m‘
So, the following holds:
where the first term is the quotient and the second the
remainder.
mn /
mnmnmn mod/
Basic Number Theory
Modular Arithmetic : Solving example
41. 41
Another way of putting this is:
Given any positive integer n and any integer m, if we divide m
by n, we get an integer quotient, q, and integer remainder, r,
that obey the following relationship:
The remainder, r, is often referred to as a residue of m
modulo n, and is the smallest non-negative integer that
differs from m by a multiple of n.
For example,
)/;0( nmqnrrqnm
337)2(11;7;11
447111;7;11
rnm
rnm
Basic Number Theory
Modular Arithmetic
42. 42
Two integers, a and b are said to be congruent (denoted by )
if:
that is, "a is congruent to b modulo m"
Alternatively, in arithmetic modulo m, a and b are equivalent
if their difference, (a - b), is a multiple of m; that is, m | (a - b)
The set of integers Zm = {0,1, ... m - 1} form the complete set
of residues modulo m -- there are only m different integers,
mod m
The operation a mod m denotes the residue of a, such that the
residue is some integer from 0 to m - 1. This operation is known
as a modular reduction.
Example:
mbmamba modmod)(mod
)210(|4because)4(mod210
Basic Number Theory
Modular Arithmetic
43. 43
Congruence is an equivalence relation --
that is, it satisfies:
Finding the smallest non-negative integer to
which k is congruent modulo n is called
reducing k modulo n
cacba
abba
aa
:The3)
:The2)
:The1)
lawtransitive
lawsymmetric
lawreflexive
Basic Number Theory
Modular Arithmetic
44. 44
We can also add and subtract congruent
elements without losing congruence:
Multiplication also works:
)(mod
)(modand
mdbca
mdbcadcba
b, cmbdacdcba integersfor,)(modand
Basic Number Theory
Modular Arithmetic
45. 45
Modular arithmetic is like ordinary arithmetic. It
is:
commutative (for addition and multiplication)
a + b = b + a
associative
(a + b) + c = a + (b + c)
and
distributive
a(b + c) = (ab) + (ac)
and
(b + c)a = (ba) + (ca)
Basic Number Theory
Modular Arithmetic
46. 46
Modular Arithmetic
A very important property of modular arithmetic is:
Reducing each intermediate result modulo m yields the
same result as doing the entire calculation, and then
reducing the result to modulo m:
This means that we can do modular arithmetic without
worrying about whether we will exceed some large
arithmetic bound -- so such calculations can be done on
computers, even for large integer values.
mmcambamcba
mmbmamba
mmbmamba
mmbmamba
mod))mod)(()mod)(((mod))((
mod))mod()mod((mod)(
mod))mod()mod((mod)(
mod))mod()mod((mod)(
Basic Number Theory
47. 47
Here are the possible values of (a + b)
mod 8:
and (a·b) mod 8:
Try a Java applet which
demonstrates modular
arithmetic
Basic Number Theory
Modular Arithmetic
48. 48
Recall that exponentiation is defined:
In ordinary arithmetic, exponentiation rapidly produces very
large numbers
However, because of the important property of modular
arithmetic that intermediate results can be computed mod m,
then is is possible in mod m arithmetic to do powerful
exponentiation without producing very large numbers
Remember, in cryptography, we'll be dealing with very large
values of m, so this is important.
aa'a'a
n-aaaa
ea
n-n
n
ofinversetheiswhere,)(
times)1applied(i.e.
elementidentitythe,0
Basic Number Theory
Modular Arithmetic
Exponentiation
49. 49
Modular Arithmetic: Exponentiation
For example, instead of performing the calculation:
we can instead perform fewer multiplications and use
intermediate modular reductions.
Let's take a specific case of a8 mod n. We can calculate it:
Similarly:
)(mod aaaaaman
mmmama mod)mod)mod((mod 2228
mammmmamama
mmmmama
mod))mod)mod)mod)mod))mod(((((((mod
mod)mod)mod)mod(((mod
222225
222216
Basic Number Theory
50. 50
Modular Arithmetic: Division
So far, for mod m arithmetic, we have addition, subtraction (defined
through an additive inverse), and multiplication.
What about division?
Division is defined through a multiplicative inverse.
In regular arithmetic:
The multiplicative inverse of 5 is 1/5, because 5·1/5 = 1
In modular arithmetic, things are not so easy:
which is equivalent to finding an x and a k (both integers) such that:
5x = 7k + 1
The general problem is to find x such that:
)7(mod15where,Find xx
)(mod
:or
mod)(1
1
mxa
mxa
Basic Number TheoryBasic Number Theory
52. 52
Modular Arithmetic: Multiplicative Inverse
Sometimes the modular multiplicative
inverse has a solution, and sometimes it
doesn't:
The inverse of 5, mod 14, is 3
5*3 mod 14 = 1
The inverse of 2, mod 14, doesn't exist.
Look at the row for 2, at right;
It does not contain a value 1
It turns out that has
a solution iff a and n are relatively
prime.
For example, look at the rows to the right.
The only rows that contain a 1 are for
values that are relatively prime to 14:
1, 3, 5, 9, 11, 13
)(mod1
mxa
The mod 14 multiplication
table.
Basic Number Theory
53. 53
Modular Arithmetic: Multiplicative Inverse
One way of finding the inverse of a modulo m is to extend
Euclid's greatest common divisor algorithm:
The Extended Euclidean Algorithm:
While computing gcd(a, m), we can also find two integers u and
v such that:
gcd(a, m) = ua + vm
If a and m are relatively prime, then the gcd(a, m) = 1, and:
1 = ua + vm = ua (mod m) (performing a reduction mod m)
and then, multiplying both sides by a-1:
a-1 = ua·a-1 = u
So, if gcd(a, m) = 1, then u is the multiplicative inverse of a mod m;
otherwise, there is no multiplicative inverse
Basic Number Theory
54. 54
Finite, or Galois Fields
A finite field (also known as a Galois* Field) is a field
with a finite number of elements. Finite fields are
critical to the success of many cryptographic
algorithms.
The finite fields are completely known:
It can be shown that the order of a finite field (number of elements in the
field) must be a power of a prime, pn, where n is a positive integer.
For a given prime, p, the finite field of order p, GF(p) is
defined as the set Zp of integers {0, 1, ... , p - 1}, together
with the arithmetic operations modulo p.
*Evariste Galois (1811-1832), French
mathematician
Basic Number Theory
55. 55
Modular Arithmetic
Here are the values for (a + b) mod 2:
and (a·b) mod 2:
Notice anything?
baba
baba
2mod)(
2mod)(
AND
XOR
Try a Java applet which demonstrates modular
arithmetic
Basic Number Theory
56. 56
Modular Arithmetic
Another useful feature of arithmetic mod
2 is:
In the field Z2, ({0, 1}), there is only one inversion
possible:
1/1 = 1
so division is the same operation as multiplication!
Not surprisingly, the field Z2 is an
important tool to analyze certain
cryptographic algorithms by computer.
Basic Number Theory
57. 57
Modular Arithmetic
Cryptography uses modular arithmetic a great deal, because:
Calculating discrete logarithms and square roots mod n can be
hard problems.
It's easier to work with on computers, because it restricts the
range of all intermediate values and results
For a k-bit modulus, n, the intermediate results of any addition, subtraction, or
multiplication will not exceed 2k bits in length.
We can perform modular exponentiation without generating huge intermediate results
Arithmetic operations, mod 2, are natural for computers, because of the equivalence of
addition with XOR, and multiplication with AND, etc.
Basic Number Theory
58. 58
Zn*
Z is the set of all integers
We've seen that Zn is the set of integers mod n
Z10 = {0,1,2,3,4,5,6,7,8,9}
Zn* is defined as the set of mod n integers that are
relatively prime to n
Z10* = {1,3,7,9} (0 is missing because gcd(0, 10)
= 10)
Basic Number Theory
59. 59
Zn*
The multiplication table for Z10* provides some
surprises:
Notice anything?
1 3 7 9
1 1 3 7 9
3 3 9 1 7
7 7 1 9 3
9 9 7 3 1
• Every element in Z10* is present in the table, and no
other elements other than those are present.
Furthermore, every element in Z10* is present in every
row of the table.
What does this mean for Z10*?
• It turns out that this is true for all n:
Zn* is closed under multiplication mod n
Basic Number Theory
60. 60
Fermat's Little Theorem
*Fermat's Little Theorem states:
If p is prime and a is a positive integer not divisible by p,
then:
If we multiply both sides by a, we can come up with an
alternative form:
*Pierre de Fermat (1601 - 1665), French mathematician most
famous for Fermat's Last Theorem, which was considered one of
mathematics' most difficult theorems, and has only recently
been finally proven. His Little Theorem has nothing to do with
his Last Theorem.
pap
mod11
paaaa pp
mod1
Basic Number Theory
61. 61
Euler's Totient Function
An important quantity in number theory is *Euler's
Totient Function:
The number of positive integers less than n, that are
relatively prime to n.
It is written :
In other words, Euler's Totient Function is the
number of elements in Zn*
composite)(for1)(φ
prime)(for1)(φ
1)1(φ
mmm
ppp
)(φ n
*Leonhard Euler (1707 - 1783), Swiss mathematician
)(φ n
Basic Number Theory
62. 62
Euler's Totient Function
Assume we have two distinct prime numbers, p and q,
and an integer n = pq
Then:
The set of residues in Zn i s{0,1,...,(pq - 1)}
The residues that are not relatively prime to n are:
The set {p, 2p, ... ,(q - 1)p}, the set {q, 2q, ... ,(p - 1)q}, and
0
So:
)1()1()(φ)(φ)(φ)(φ qpqppqn
)(φ)(φ
)1()1(
1)(
]1)1()1[()(φ
qp
qp
qppq
pqpqn
Basic Number Theory
63. 63
Euler's Totient Function
Euler Totient Function
0
5
10
15
20
25
30
35
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
n
Totient(n)
• Here is what the Euler Totient Function values look like for
small values of n. (The dotted red line is the line f(n) = n - 1)
Basic Number Theory