# NK Cryptography

Τεχνίτη Νοημοσύνη και Ρομποτική

21 Νοε 2013 (πριν από 4 χρόνια και 7 μήνες)

117 εμφανίσεις

1

NK Cryptography

Dr.

*

Ali D. Katheeth*

nidhalka@it.kuiraq.com

alidg@kuiraq.com

Abd
u
l

H
uss
ie
n

.
A. Moh
ammed
Ali
*

Iman H. Raheem**

a1_hussein@yahoo.com

Abstract

One of the effective technologies that used to deal with security issues is the
cryptography that can be used to insure confidentiality, integrity, and availab
ility for data
when they are stored, transmitted or processed. This paper present new cryptography
way
depending on changing
ASCII

code for each letter in
plain
text

to another code
depending on
new value assign to plain text letter
in plaintext
, and these
codes will
grouping according to specific key before process each group by special equation use to
this purpo
se. This method reduce
plain
text

size after encrypted, and give very high
probabilities of producing

different

encrypted

letter
/symbol

from one
pla
in
text

letter.

Key Words : Cryptography, Cipher, R
educe size
, Nk cryptography

*
Kufa University
-

Computer Center

**Al Mustansyriaa University
-

Education College

2

1.

Introduction

The idea of a cipher system is to disguise confidenti
al information in such a way that its
meaning is unintelligible to an unauthorized person. The two most common uses are,
probably, to store data securely in a computer file or to transmit it across an insecure
channel such as the Internet. In either scenar
io the fact that the document is encrypted
, but
rather, ensures that they
cannot understand what they see.

The information to be concealed is often called the
plaintext

and the operation of
disguisi
ng it is known as
encryption.

The encrypted plaintext is called the
ciphertext

or
cryptogram

and the set of rules used to encrypt information
plaintext

is the
encryption
algorithm.

Normally the operation of this algorithm depends on an
encryption key,

whic
h
is input to the algorithm together with the message. In order that the recipient can obtain
the message from the cryptogram there has to be a
decryption algorithm

which, when
used with the appropriate
decryption key,

reproduces the plaintext from the cip
hertext.

Any person who intercepts a message during transmission is called, not surprisingly, an
interceptor.

Other authors use different t
erms, including 'eavesdropper',
'enemy',
'adversary', or even 'bad guy'. However, it must be recognized that, on occas
ions, the
interceptors may be the 'good guys'; more about them later. Even if they know the
decryption algorithm, interceptors do not, in general, know the decryption key. It is this
lack of knowledge that, it is hoped, prevents them from knowing the plain
text.
Cryptography

is the science of designing of cipher systems, whereas
cryptanalysis

is the
name given to the process of deducing information about plaintext from the ciphertext
without being given the appropriate key.
Cryptology

is the collective term
for both
cryptography and cryptanalysis.

It is very important to realize that cryptanalysis may not be the only means by which an

In practice most cryptanalytic attacks involve trying to determine the decryption k
ey. If
successful, the attacker then has the same knowledge as the intended recipient and is able
to decrypt all other communications until the keys are changed. However there may be
instances where an attacker's sole objective is to read a particular mess
age. Nevertheless
when authors refer to an algorithm as being
broken,

they usually mean that an attacker
has found a practical way of determining the decryption key.

Of course, the attacker is only able to break an algorithm if they have sufficient
informa
tion to enable them to recognize the correct key or, more frequently, to identify
incorrect keys. It is important to realize that this extra information is likely to be crucial
to the attacker
.

One important fact that should already be clear from our intro
duction is that knowledge
of the encryption key is not necessary for obtaining the message from the cryptogram.

3

A cipher system is called
conventional

or
symmetric
if it easy to deduce the decryption
key from the encryption key. In practice, for symmetric

systems, these two keys are often
identical. For this reason, such systems are frequently called
secret key

or
one
-
key

systems. However, if it is practically impossible to deduce the decryption key from the
encryption key, then the system is called
asymme
tric

or
public key.

One reason for
distinguishing between these two types of system should be clear. In order to prevent an
interceptor with knowledge of the algorithm from obtaining the plaintext from
intercepted ciphertext it is essential that the decryp
tion key should be secret. Whereas for
a symmetric system this necessitates that the encryption key should also be secret, if the
system is asymmetric then knowledge of this key is of no practical use to the attacker.
Indeed it can be, and usually is, made

public. One consequence of this is that there is no
need for the sender and receiver of a cryptogram to share any common secrets. In fact
there may be no need for them to trust each other.

2.

Uses of cryptography

Cryptography is commonly used to ensure the
detection of unauthorized alterations to
documents. Indeed, at least for the commercial sector, the provision of confidentiality is
no longer its major application. In addition to its traditional use for privacy, cryptography
is now used to provide:

data i
ntegrity
: assurance that information has not been altered by unauthorized or
unknown means;

entity authentication
: corroborating the identity of an entity;

data origin authentication
: corroborating the source of the information;

non
-
repudiation
: preventing

the denial (this is usually by the originator) of the
content of the information and/or the identity of the originator.

Following a number of disjointed situations where the use of cryptography facilitates the
provision of a secure service. Many of them r
epresent scenarios that the man in the street
encounters almost every day, but probably does not appreciate either the security risks or
the role played by encryption.

Some ATM (Automated Telling Machine ) networks now use smart cards, which
enable the use

of public key cryptography. A user's card then contains their
private key and a certificate, signed by the card issuer, to confirm their public key
value.

In a typical Pay TV system each
programmed

is encrypted with its own unique
key prior to transmissio
n. Those who pay for a particular
programmed

are then
essentially paying for knowledge of the key.

PGP
(Pretty

Good
Privacy) uses

a two
-
level key hierarchy in which symmetric
session keys are used to protect data, and asymmetric keys are used for both
sign
ature and the protection of the symmetric session keys. PGP has many uses
including securing email and the secure storage of files.

4

Secure web browsing is an essential feature of e
-
commerce. The
Secure Sockets
Layer (SSL)

and the
Transport Layer Security (
TLS)
are two important protocols
that are used to verify the authenticity of websites. They facilitate the use of
encryption for sensitive data and help to ensure the integrity of information
exchanged between web browsers and websites.

Since intercepting
radio signals is likely to be easier than intercepting landline
calls, one of the initial security requirements for GSM was that their mobile
phones should be no less secure than the conventional fixed telephones. This
requirement was satisfied by providin
g encryption for transmissions from the
handset to the nearest base station. Another serious security issue was the problem
of the operator being able to identify the phone so that they knew whom to
charge.

3.

Strength

Everyone wants a practical
cipher which

is
proven
“absolutely

secure," but

s
uch a cipher
does not exist, and probably never will. Even the
famed”

unbreakable" one
-
OTP) is mainly a theoretical concept: The

OTP which is proven
“Unconditionally

secure"
is
not
the
realized OTP

which is
theoretical
OTP which has an
ideal theoretical
-
class random keying source. We cannot build such a source, but even if
we could, we could not
prove
it, and
absolute proof
is required
for mathematical
-

level
guarantees. None of
this prevents a cipher from being
effectively unbreakable
;

of course,
it just means that we cannot expect to attain theoretical ideals in the real world. There is
NO
theory of cipher strength such that, if we only follow the rules, we are guaranteed a

stro
ng cipher. Nobody who will talk can even
measure
the strength of

an arbitrary cipher.
This means that cipher construction is fundamentally
art
science,
despite the
fact that strength is
argued
excruciating technical detail. Unfortunately, thes
e arguments
will be quite unintelligible to the average customer or cipher user.

4.

Modern algorithms

One
-

part and two
-

part codes

Most codes involve the use of a
code
-

book
, which may contain thousands of
code
groups
. A code used by the military w
ould
typically represent letters, numbers or phrases
by code groups consisting of four or five letters or digits.

4.1

Bit
-
strings

As we stressed earlier, most modern ciphers do not involve letter substitutions. Instead
they tend to use an encoding scheme to conver
t the message into a sequence of binary
digits (bits), that is, zeros and ones. The most commonly used encoding scheme is
probably ASCII (American Standard Code for Information Interchange). This bit
5

sequence representing the plaintext is then encrypted to

give the ciphertext as a bit
sequence.

The encryption algorithm may act on a bit
-
string in a number of ways. One 'natural'
division is between
stream ciphers,

where the sequence is encrypted bit
-
by
-
bit, and
block
ciphers,

where the sequence is divided int
o blocks of a predetermined size. ASCII
requires eight bits to represent one character, and so for a block cipher that has 64
-
bit
blocks, the encryption algorithm acts on eight characters at once.

It is very important to realize that the same bit
-
string ca
n be written in many different
ways and, in particular, that the way that it is written may depend upon the size of the
blocks into which it is divided.

4.2

Stream ciphers

Various authors use the term stream cipher slightly differently. Many talk about word
-
ba
sed, or character
-
based, stream ciphers. Here the message is enciphered word by word
(or character by character), where the rule for the encryption of each word (character) is
determined by its position in the message. The Vigenère Cipher, and the one
-
time

both fit this definition. Perhaps the best
-
known historical example is the celebrated
Enigma cipher. However, the most common modern use of the term
stream cipher,

and
the one that we adopt, is a cipher where the plaintext is enciphered bit by bit. Cl
early all
that can happen to any particular bit is that its value is changed to the alternative value or
left unchanged. Since a bit can have one of only two values, changing a bit means
replacing it by the other value. Furthermore, if a bit is changed twi
ce, then it returns to its
original value.

If an attacker knows that a stream cipher has been used, then their task is to try to identify
the positions of those bits which have been changed, and to change them back to their
original values. If there is any

easily detectable pattern that identifies the changed bits
then the attacker's task may be simple. Thus the positions of the changed bits must be
unpredictable to the attacker but, as always, the genuine receiver needs to be able to
identify them easily.

For a stream cipher we can think of the encipherment process as a sequence of the
following two operations: change and leave unchanged. This sequence is determined by
the encryption key and is often called the
keystream sequence.

For simplicity and brevity
,
we can agree to write 0 to mean 'leave unchanged' and 1 to mean 'change'. We are now in
the position where the plaintext, ciphertext and keystream are all binary sequences.

4.3

Block ciphers (ECB mode)

For a
block cipher,

the bit
-
string is divided into block
s of a given size and the encryption
algorithm acts on that block to produce a cryptogram block that, for most symmetric
ciphers, has the same size.

Block ciphers have many applications. They can be used to provide confidentiality, data
integrity, or user
authentication, and can even be used to provide the key

stream generator
for stream ciphers. As with stream ciphers,

it is very difficult to give a precise
6

assessment of their security. Clearly, as we have already seen, the key size provides an
upper boun
d of an algorithm's cryptographic strengt
h. However, as we saw with the
S
imple Substitution Ciphers
, having a large number of keys is no guarantee of strength. A
symmetric algorithm is said to be
well designed

if an exhaustive key search is the
simplest fo
rm of attack. Of course, an algorithm can be well designed but, if the number
of keys is too small, also be easy to break.

Designing strong encryption algorithms is a specialized skill. Nevertheless there are a
few obvious properties that a strong block ci
pher should possess and which are easy to
explain. If an attacker has obtained a known plaintext and ciphertext pair for an unknown
key, then that should not enable them to deduce easily the ciphertext corresponding to
any other plaintext block. For exampl
e, an algorithm in which changing the plaintext
block in a known way produces a predictable change in the ciphertext, would not have
this property. This is just one reason for requiring a block cipher to satisfy the
diffusion
property

which is that a small

change in the plaintext, maybe for example in one or two
positions, should produce an unpredictable change in the ciphertext.

4.4

Hash functions

So far we have concentrated on encryption algorithms that can be used to provide
confidentiality. These algorithms

have the fundamental basic property that they are
reversible in the sense that, with knowledge of the appropriate key, it must be possible to
reconstruct the plaintext message from the cryptogram. However, there are many
instances where cryptography is us
ed, but where there is no need to be able to deduce the
original 'message' from its encrypted form. In fact there may be a definite requirement
that it should not be possible. One example might be the protection of passwords on a
computer system. Users are

instructed to keep their passwords secret, and thus it is
reasonable to assume that the system also tries to ensure this confidentiality.

There are also many instances in cryptography where large messages need to be
condensed into short bit
-
strings (cons
iderably shorter than the length of the original
message). When this occurs, then it is inevitable that more than one message can give rise
to the same shorter bit
-
string and this automatically implies that the process is
irreversible. These functions are
known as
hash functions

and, depending on the
application, they may or may not involve the use of a cryptographic key.

The basic idea of a hash function is that the resultant hash value is a condensed
representative image of the message. The hashed value h
as a number of names including
digital fingerprint, message digest,

or, not surprisingly, a
hash.

Hashing has a number of
applications, including the provision of data integrity and as part of the digital signature
process.

In general hash functions accept

inputs of arbitrary length but produce outputs of a fixed
length. If two inputs result in the same output then we say that a
collision

has occurred.
As we have already noted, the existence of collisions is inevitable. Thus, if we want to
identify a messag
e uniquely by its digital fingerprint, the hash function must be carefully
chosen to ensure that, even though collisions exist, it is virtually impossible to find them.

7

4.5

Public key systems

We have so far considered only symmetric algorithms where the sende
share a secret key. This, of course, implies trust between the two parties. Prior to the late
1970s, these were the only algorithms available.

The basic idea of a public key cryptosystem is that each entity has a
public key

and a
correspondi
ng
private key.

These keys are chosen so that it is practically impossible to
deduce the private key from the public key. Anyone wishing to use this system to send a
secret message to someone else needs to obtain that person's public key and use it to
encr
ypt the data. It is, of course, necessary that they have confidence that they are using
the correct public key because, otherwise, it is the owner of the private key corresponding
to the public key used, as opposed to the intended recipient, who can unders
tand the
message. Thus, although there is no need to distribute them secretly, all public keys need
protection in the sense that their authenticity must be assured. It is also worth observing
that when a public key system is used to provide confidentiality

then, since the public
encryption key is widely known and can be used by everyone, the ciphertext does not
provide any authentication of the sender.

For a public key system both the algorithm and the encryption key are public. Thus an
attacker is faced w
ith the task of trying to deduce the message from the cryptogram,
which was obtained by a method of which he has complete knowledge. Clearly the
encryption process needs to be chosen very carefully to ensure that the attacker's task is
difficult. However,
it must not be forgotten that the genuine receiver needs to be able to
decrypt easily. Thus the process must be chosen so that knowledge of the decryption key
facilitates the determination of the message from the cryptogram.

4.6

Random Numbers and Random Numbe
r Sequences

Random numbers are unordered numbers that are independent of preceding and
succeeding numbers. Thus, a random number sequence is an unordered series of random
numbers.

The use of random number sequences in cryptology provides a mechanism to cr
eate an
unbreakable enciphered message.

5.

Proposal A
lgorithm

Paper presents

a method to convert
plain
text

int
o
cipher
text

according to the following
steps:

5.1

C
ounting redu
ndancy for each letter in plain
text
. Plaintext
in figure (
1) used

as
example.

5.2

Sorting l
etters according to their frequency from most frequent letter to least
frequent one. Table (1) show the frequency of plaintext letters in figure (1).

5.3

Numbering each letter in table(1) starting from zero. This number represents the
new letter codes shown in

table (2).

8

Figure

( 1 ): Plaintext used as example to
encrypt
.

5.4

Rewriting the plaintext by replacing each letter with the corresponding number
from table (2) to get a new file with a sequence of integer numbers as shown in
figure (2).

5.5

Div
iding a new file (from step 4) to equal groups (number of integer code in each
group is a key length), the key length change each time encrypt a text (in this
example we choose key length with 3 code.)

as shown in figure (
3
)

Key (as a word) hidde
n in

plain
text in special position (in this

example first word

in plain text is "three" (key length)
).

Also letters of table(2) hidden in plaintext in the same sequence

Starting from zero.

5.6

By using equation (2)
convert each group
to a unique integer number,
where
equation (2) is a specific equation for converting three integer numbers to one
uniq
ue number , while equation (1) ( its one to one and onto)
is a general form
equation and can be used to any number of integer numbers.

Not
e, for each group of codes there is specific reverse equation taking the unique number
as input and produce the origin numbers with the same value and same orders.

Through this example we used group of three numbers (mean 3 byte), and the resulting
unique
number from three numbers by using equation
(2
)
need no

more

than

(2
byte).

one of the building blocks of security is encryption which provides a
means of scrambling data for secure trans
mission to other parties. in
cryptographic terms the data or message to be encrypted is referred to
as plaintext and the resulting encrypted block of text as ciphertext. a
number of processes exist for converting plaintext into ciphertext
through the use o
f keys which are essentially random numbers of a
specified length used to lock and unlock date. this conversion is
achieved by applying the keys to the plaintext by following a set of
mathematical instructions referred to as the encryption algorithm.

9

(x
1
, x
2
, x
3
,……,x
m

)

w1 = [((

m
i
m
xi
1
1
)(

m
i
m
xi
1
2
) ….

m
i
xi
1
) / (m*(m
-
1)*...*1)] + [((

1
1
2
m
i
m
xi

) (

1
1
3
m
i
m
xi
)…..

m
i
xi
1
) / ((m
-
1)*(m
-
2)*...*1) ] +
…….+[((x
2

+ x
1

+1)( (x
2

+ x
1

) / 2*1)]+ x
1

……
........................................ (1)

(x1
, x2, x3
)

w1 = [ (x1+
x2+x3+2) (x1+x2+x3+1) (x1+x2+x3)] / 3!

+

[(x1+x2+1)

(x1+x2)]

/
2!
+ x1

……
........................................
(2)

5.7

Resulting numbers from step (
5.
6) store in file as an (ASCII code ), and when
display by word pro
cessor it display the corresponding characters according to i
ts
(ASCII code), as in figure (4
).

Table ( 1 ): Frequency of plaintext letters show in figure(1)

Frequency

Letter ( symbols )

94

space

61

e

52

t

39

o

38

i

37

S

36

r

34

n

33

a

24

C

22

h

18

l

17

P

15

d

41

f

12

Y

11

g

11

M

11

u

9

p

7

x

6

k

4

v

4

.

3

w

10

Table ( 2 ): New code for letters
\

symbols of plaintext in figure (1).

New code

Letter (
symbol
s)

8

a

19

b

9

c

13

d

1

e

14

f

16

g

10

h

4

i

25

g

21

k

11

l

17

m

7

n

3

o

12

p

26

q

6

r

5

s

2

t

18

u

22

v

24

w

20

x

15

y

27

z

23

.

28

,

0

"space"

11

Figure (2):

New file with codes instead of letters (
A
SCII codes )

3 7

1 0 3 14 0 2 10 1 0 19 18 4 11 13 4 7 16 0 19 11 3 9 21 5 0 3 14 0
5 1 9 18 6 4 2 15 0 4 5 0 1 7 9 6 15 12 2 4 3 7 24 10 4 9 10 0 12 6 3 22
4 13 1 5 0 8 0 17 1 8 7 5 0 3 14 0 5 9 6 8 17 19 11 4 7 16 0 13 8 2 8 0
14 3 6 0 5 1 9 18 6 1 0 2 6 8 7 5 17 4 5 5
4 3 7 0 2 3 0 3 2 10 1 6 0 12
8 6 2 4 1 5
23 0 4 7 0 9 6 15 12 2 3 16 6 8 12 10 4 9 0 2 1 6 17 5 2 10
1 0 13 8 2 8 0 3 6 0 17 1 5 5 8 16 1 0 2 3 0 19 1 0 1 7 9 6 15 12 2 1 13
0 4 5 0 6 1 14 1 6 6 1 13 0 2 3 0 8 5 0 12 11 8 4 7 2 1 20 2 8 7 13 0 2
10 1 0 6 1 5 13 11 2 4 7 16 0 1 7 9 6 15 12 2 1 13
0 19 11 3 9 21 0 3
14 0 2 1 20 2 0 8 5 0 9 4 12 10 1 6 2 1 20 2 23 0 8 0 7 18 17 19 1 6 0 3
14 0 12 6 3 9 1 5 5 1 5 0 1 20 4 5 2 0 14 3 6 0 9 3 7 22 1 6 2 4 7 16 0
12 11 8 4 7 2 1 20 2 0 4 7 2 3 0 9 4 12 10 1 6 2 1 20 2 0 2 10 6 3 18 16
10 0 2 10 1 0 18 5
1 0 3 14 0 21 1 15 5 24 10 4 9 10 0 8 6 1 0 1 5 5 1 7
2 4 8 11 11 15 0 6 8 7 13 3 17 0 7 18 17 19 1 6 5 0 3 14 0 8 0 5 12 1 9
4 14 4 1 13 0 11 1 7 16 2 10 0 18 5 1 13 0 2 3 0 11 3 9 21 0 8 7 13 0
18 7 11 3 9 21 0 13 8 2 8 23 0 2 10 4 5 0 9 3 7 22 1 6 5 4 3

7 0 4 5 0 8
9 10 4 1 22 1 13 0 19 15 0 8 12 12 11 15 4 7 16 0 2 10 1 0 21 1 15 5 0
2 3 0 2 10 1 0 12 11 8 4 7 2 1 20 2 0 19 15 0 14 3 11 11 3 24 4 7 16 0
8 0 5 1 2 0 3 14 0 17 8 2 10 1 17 8 2 4 9 8 11 0 4 7 5 2 6 18 9 2 4 3 7 5
6 1 14 1 6 6 1 13 0 2 3 0 8

5 0 2 10 1 0 1 7 9 6 15 12 2 4 3 7
0 8 11 16
3 3 4 2 10 17 23

12

F
igure (3) : New file divided every three d
igit to group.

Figure (4) :The resulting cipher text

13

6

Conclusion
:

T
his method has many force points

6.1

Plain text can represent a
bout 32 or may be little more if we use the
number in text ... and the number of characters yield
in cipher text
is (256
)
character , this give a wide range for representation
n
umber of letter
, for

each letter in
plain text

depending on neighbor letters.

6.2

Minimize the encrypted text file size with about (30%
) (Every

three
symbol transformed into 2 symbols).

6.3

T
his algorithm ca
n use to any language.

6.4

Complexity

of decrypt the encryption file
comes

from

:

a)

V
ariant of key length
.

b)

V
alue of each letter depended on frequency of that letter in plain text
file

c)

R
everse equations vary with varying key length .

d)

E
ncrypted file size is less
than the origin file , and thus not give idea

e)

A
ny
set of

plain text
letter
s

give many different
set of
characters in
cipher text
. Probability of yielding different set of characters from one
set of plain text character (consist
of three characters as a key length for
30 different letters in plain text
)

equal 30*30*30=27000 different group
(each group consist of two symbols)
.

14

References

1.

Fred Piper

and

Sean Murphy

,

Cryptography: A Very Short Introduction

Oxford U

2.

Rolf Oppliger.p.cm

,

Contemporary cryptography

Library of Congress
-
in
-
Publication Data

(Artech House
computer security series), 2005

3.

R.F. Churchhouse

“ Codes and ciphers Julius Caesar, the Enigma and the

internet
”, Published by the press syndicate of the university of Cambridge 2004

4.

Terry Ritter,P.E. “
Cryptography
-

New Encryption Technologies for

Communications designers
”, (eBook) 1999

5.

Wenbo Mao Hewlett
, "

Modern Cryptography: Theory and Practice”,

Publisher:Prentice Hall PTR Pub Date: July 25, 2003

15

هصلاخلا

لماكت نم دكأتلل مدختسي يذلاو هينملاا اياضقلا عم لماعتت يتلا هلاعفلا تاينقتلا نم دحاو وه ريفشتلا
.ةجلاعملاو لقنلا, نزخلا ءانثا تانايبلا رفوتو ةيقوثو,

ةرفش رييغت ىلع دمتعت ةديدج ريفشت ةقيرط مدقي ثحبلا اذه
ASCII

زمر وا فرح لكل
صنلا يف
رفش ىلا حيرصلا
تاريغتملا هذهل دنتست ةديدج ميق ىلع
ً
ادامتعا ةديدج ه
,

ىلا مسقت تارفشلا هذه
مدختست ةصاخ ةيضاير ةلداعم ةطساوب ةعومجم لك ةجلاعم متت نا لبق صاخ حاتفمل
ً
اقفو عيماجم
.ضرغلا اذهل

اهنا نع
ً
لاضف ميدقلا صنلا مجح ىلا ةبسن رفشملا صنلا مجح للقت اهنا ةقيرطلا هذه ايازم نم

يطعت
هرم لك يف فلتخي رفشم فرح جاتنلا هريبك هيلامتحا
يف هعقوم بسح حيحصلا فرحلا سفن رفشن
.حيرصلا صنلا