Symmetric Cryptosystem Based on Petri Net

‎ In this wok, a novel approach based on ordinary Petri net is used to generate private key . The reachability marking of petri net is used as encryption/decryption key to provide more complex key . The same ordinary Petri Nets models are used for the sender(encryption) and the receiver(decryption).The plaintext has been permutated using look-up table XOR-ed with key to generate cipher text


1.Introduction
One of the most used in information security is Cryptography ,one of its services is protected sensitive information to discover by unauthorized people or made modification on it during sending or storage. Cryptography depends upon two basic elements: cryptography algorithm and key generator algorithm . key stream generator has a short input(seed) and a long output, the two party(sender and receiver) have the same input and generate the same key, our project use petri net as generator. Petri net is mathematical graphical model ,consists three component ,places , transitions and arc that connect one place to one transition or one transition to one place, each arc labels with its weight(positive integer), each place may hold either zero or a positive number of tokens or mark. A marking of net is denoted by M, it consists tokens of all places, short key(seed) is used as initial marking to the first places of petri net ,firing of enabled transition chance the token in petri net according to the weights of arc and number of firing which can be change according to the agreement between sender and receiver ,this generated random long number . The plaintext has been permutated using look-up table, each plaintext is permutated in differ form according to the key . And finally the plaintext and key have been mixed to generate ciphertext.

Related works
There are few paper that used petri net as a tool to generate public key sequence based on the average of token or complicated of more than one petri net .
1-"A Public-Key Cryptosystem Based On Stochastic Petri Net"(Zuohua Dinga, Hui Zhoua, Hui Shena, Qi-wei Geb)2014. They have developed a public-key cryptosystm based on They have developed a public-key cryptosystm based on scope of initial marking and average number of token in places of stochastic petri net, in decryption process used CPN. The markings in coverability tree are used in key generation, and the plaintext can be encrypted in many steps. This system has higher security than other like RSA. 2-"Construction of Petri nets and Calculation of Elementary T invariants for Multi-stage-Encryptions Public-Key Cryptography: MEPKC"(Ryo Yamaguchi , Qi-Wei Ge and Mitsuru Nakata,Graduate School of Education, Yamaguchi University) 2008. They have proposed a method, by collecting two Petri nets, in order to increase complex of petri nets to be used as a key generator of a public-key cryptography.

Symmetric Cryptography
Cryptography is the study of information security and provide possibility of connecting over an insecure channel to protect information during transmission. Information security is become most important in general modern business and technology for privacy of communications and transmission. Good cryptography gets its security by using complex keys . [Shafi ,Mihir 08] Cryptography can be divided into asymmetric cipher and symmetric cipher ,A symmetric cipher which use public key to encrypt message and secret key to decrypt it , while symmetric cipher use the same secret key to encrypted and decrypted the message [Paar & Pelzl 10] In symmetric cipher , the sender and receiver shared secret key by secure channel which will be used in the encryption/decryption algorithm .Symmetric cipher consists three algorithm the randomized key generation algorithm, encryption algorithm and decryption algorithm .The randomized key generation algorithm are used to generated random number, it considers as basic role in the use of cryptography in various security application, the security of algorithms which use it are based on the assumption that it is infeasible to distinguish when a random sequence is being used . A generator began with short random bit string (as a seed) and extend it to become long complex bit string, it should be as long as plaintext to maintain high security . Random number generator are deterministic functions, so it based on the seed, sender and receiver have been agreed on the same seed which must be randomly and shared it over secure channel to get same secret key, which will be xor-ed with the plaintext. [Andrea 2005]

4.Petri Nets
Petri nets are graphical and mathematical tool, it has been used in many applications including the modeling and analysis of discrete-event systems ,concurrent systems , fault tolerant systems , communication protocols, distributed-software systems , control systems and parallel systems . [Jiacun ] A Petri net is a weighted directed graphs, it consists two types of nodes, the place(represented by circle) and transition(represented by bar), place and transition connected by directed arcs either from place to transition or transition to place ,each arc are labeled with weight. [Bab 01] A marking of net is labeled by M, (m vector where m is the total number of places), the pth component of M denoted by M(p),is the number of tokens in place p. Transition t is enabled when each input place is marked with at least w tokens, where w is the weight of the input arc of that transition).
A firing on an enabled transition deletes token from each input place p, and adds token to each output place according to the weight of associative arc, see fig (1). Tokenflow occurs via the firing of transitions. The system achieves a new marking via the firing of a transition. [Mutata 89] A formal definition of Petri net, is represented by five-element PN = (P,T, F,W,M0) where: P={p1,p2,p3,….,pn} is a finite set of places, T={t1,t2,t3,…..,tn} is a finite set of transitions, F≤ (P*T) (T*P) is a set of arcs (flow relation), W: F-->{1,2,3,….} is a weight function, M0:{0,1,2,3,…} is the initial marking A Petri net structure N= (P,T,F,W)without initial marking is denoted by N. A Petri net with the given initial marking is denoted by (N,M0) [Mutata 89]

Design and Implementation of the Proposed System
The Petri net was used as good tools in cryptography. We have developed cryptosystem based on petri net . We can used it to generate nonlinear random number based on the marking of petri net and flow of token according to firing of transitions. this system can supply us with complex key to be used as private key for cryptosystem . the figure (2) depict the suggested petri net model that used in our research. The algorithm (5.1) is used to generated pseudo random key sequences. The key sequences are used in encryption algorithm (5.2) to generate cipher text and decryption algorithm (5.3) to return the original message.

Algorithm for encryption
Input : plaintext message Output: cipher text message Processing including the following: 1-Obtain ASCII code of the plaintext then convert it to binary code 2-Divided the binary code into 16-bit sequence and permutated the binary code according to table (2),which indexed by S0 . 3-XORed the result with the private key .