Implementation of integrating Text based Watermarking with Pseudo-Random Number Generator(PRNG) for Cryptography Application Chee Hon Lew1, Chaw Seng Woo2, Liang Shing Ng3 Faculty of Computer Science and Information Technology University of Malaya, Malaysia Email: Cheehon2006@siswa.um.edu.my1, cswoo@um.edu.my2, lsng@um.edu.my3 Abstract—In this paper, we focus on text based watermarking techniques based on Pseudo-Random Number Generator(PRNG)for Cryptography application. We survey related work in digital watermarking, cryptography and design methodology, then implemented text based watermarking method (embedded and extract/detection of watermarks). We show our implementation result based on text based digital watermarking combined with cryptographic techniques. This paper is intended to provide a reference finding for newcomer's security designer and to promote more activities in these security issues. I.. INTRODUCTION Cryptographic applications heavily rely on pseudorandom number generators(PRNG)to generate secrets key such as session keys, passwords, and key pairs. They also require random numbers that are public such as salts. Random numbers are generated that they are unpredictable to an attacker. As well, randomness is collected from real random data to seed a PRNG, and once seeded, PRNGs produce a long bit sequence of random numbers. Unfortunately, cryptography can protect content in transit, but once decrypted, the content has no further protection. Therefore, digital watermarking has the potential to fulfill this need,because it embeds information into the host data or constructed binary pattern, where it is very difficult to be removed during normal usage. In this paper, for the convenience of the further research in this field, we present the text based watermarking techniques combined with Pseudo-Random Number Generator(PRNG)for Cryptography application. We introduce in this article a review of some of the keywords that used in current literature and attempt have clear distinction of them. Digital Watermarking(data-hiding) is the process of embedding data into a multimedia element such as an image, audio or video and text[1]. We can also define a watermark as the digital data embedded in multimedia objects such that the watermark can be detected or extracted at later times in order to make an assertion about the object. The main purpose of digital watermarking is to embed information imperceptibly and robustly in the host data. Typically the watermark contains information about the origin, ownership, destination, copy control, transaction etc.[2]. In general, a digital watermark is a code that is embedded inside an image. It acts as a digital signature, giving the image a sense of ownership or authenticity[2]. Unlike conventional cryptographic techniques, it remains present within the data even after the decryption process[2]. Pseudo-Random Number Generator(PRNG) is a cryptographic algorithm used to generate numbers that must appear strong(pseudo) random that cannot be guessed by an attacker[3]. Random numbers are typically used to generate session keys, and their quality is critical for the quality of the resulting systems. Perfect randomness is a scarce resource, currently pseudo random generators for all cryptographic applications it is sufficient to use pseudo random bits generator(PRB). A good random number generation improves the cryptographic security[4]. Pseudo-random numbers is an important roles in many fields such as statistical simulation systems, secret communication systems, modern cryptography systems, any scientific area incorporating Monte Carlo methods and so on. Cryptography is the study of secret writing.[5] It is the study of methods of sending messages in distinct form so that only the intended recipients can remove the disguise and read the message. A cipher is secret writing that means plaintext is transformed into Ciphertext[5]. This process is called encryption of the plaintext into ciphertext. More generally, it is about constructing and analyzing protocols that overcome the influence of adversaries[6] and which are related to various aspects in information security such as data confidentiality, data integrity, authentication, and nonrepudiation.[7]. Modern cryptography intersects the disciplines of mathematics, computer science, and electrical engineering. Applications of cryptography include ATM cards, computer passwords, and electronic commerce, military security and etc. Most of the research work that has been done in this field looks at increasing the output speed in computing the cryptographic results in on TRNG platform[8]. As we read another research related work in Research and Implementation of RSA Algorithm in Java[9]and Text Watermarking Using Combined Image-plus-Text Watermark[10,11], These two papers discusses two separate independent studies on RSA algorithm in Java and text watermarking using combined image based watermarking. However, due to the lack of research studies regarding to text-based digital watermarking techniques based on PRNG for Cryptography application. Therefore, we need to do this experimental research on design and implementation of text based watermarking combined with cryptographic techniques. There are a few advantages of combining watermarking with PRNG techniques: Good security for combined these two Watermarking with PRNG due to complex algorithms. It makes a hacker hard to predict it public key due to the combination RSA algorithms and Watermarking algorithms. It can protect user and software developer for authentication and data. This paper is organized as follows: Section II describes our research methodology and contributions. Section III describes proposed model and implementation of Text based Digital Watermarking Techniques embedded in Pseudo-Random Number Generator (PRNG) algorithms for Cryptography applications. Section IV shows our experimental work and results. Finally, section V, we provide our conclusion. II. RESEARCH METHODOLOGY III. PROPOSED MODEL Figure 5. The Proposed model of Text based Digital Watermarking algorithms embedded in Pseudo-Random Number Generator (PRNG) algorithms for Cryptography applications. generate PRNG bit output combined with Text based Digital Watermarking Algorithm Input Message data Seed Encryption Algorithm Reseed Watermarking Embedding process Pool Cover file Stego Object Watermarking Extraction Process End Collect Begin No Decryption algorithm unpredictable inputs The purpose of this research is to implement a text based digital watermarking that combined with Pseudo-Random Number Generator(PRNG). Thus, it will enable security designers to address digital content protection privacy concerns more efficiently. Developing a digital PRNG composed of standard Cryptography design tools is important because: It alleviates the need for embedding a text based digital watermarking design. The PRNG can be incorporated with other digital cryptographic components. No external components are required for a text based digital watermarking implementations. To our knowledge, this research article makes the following two sides contributions: My contribution work does in Cryptography area as below: A better understanding of Pseudo Random number primitives will make it easier to design and use PRNGs securely. The Modification and improvement of PRNG based on Open source RSA Algorithms. My contribution work does in Watermarking area as below: Better understanding concepts and methods of text based watermarking combined with PRNG for Cryptography application. The modification and improvement of text based Watermarking based on Open source Watermarking Algorithms. It makes a hacker hard to predict it public key due to combination open source RSA algorithms and watermarking algorithms. Yes Erase hidden data Output Message data Our implementation model is as shown in Figure 5. The above left part is generalized PRNG with periodic reseeding. PRNG with periodic reseeding that depicts a possible architecture for implementing catastrophic reseeding. The part of the internal state that is used to generate outputs should be separate from the entropy pool. The generation state should be changed only when enough entropy has been collected to resist iterative guessing attacks, according to a conservative estimate. The above right part is proposed implementation model of Text based Digital Watermarking Techniques. Although our primary emphasis is on evolution of new Text-based Digital Watermarking Technique but we are also aiming towards providing a blended solution comprising of Encryption and Text based Digital Watermarking dully added by PRNG algorithm before encryption. To focus more on the subject and proposing a closest possible feasible secure digital content solution, The combination of hidden data-plus cover (known as stego object) that holds the hidden information upon watermarking extraction process. No message data can be erased upon done RSA decryption algorithms. We shall be using Pseudo-Random Number Generator (PRNG) algorithms for embedding digital text based watermarking algorithms. IV. RESULTS AND DISCUSSIONS The following sequence of steps identifies RSA Key Generator adopted in this work. 1. Define the problems. 2. An algorithm 1: Multiple-precision library(BigInt.js) is a suite of routines for performing multiple-precision arithmetic in JavaScript. 3. An algorithm 2: Modular reduction library(Barrett.js) is a class for performing Barrett modular reduction computations in JavaScript. 4. An algorithm 3: RSA library(RSA.js) is a suite of routines for performing RSA public-key computations in JavaScript. It links algorithm 1 and algorithm 2 into algorithm 3 experimental testing for plaintext, ciphertext, verification and message keys. 5. The RSA key generator application is written in Delphi 7, which is Object Pascal. This includes a re-implementation of the multiple-precision library and the Miller-Rabin test for primality. Keys are generated using Algorithm 8.1 from the Handbook of Applied Cryptography[12]-[13]. The following is procedures for compiling and testing RSA Key Generator. 1. Before the testing “RSA Key generator testing file”, make sure all files(BigInt.js,Barrett.js, RSA.js) including in the same directory. 2. Open “RSA-testing” file by using Internet Explorer browser(such as Microsoft IE9, Google Chrome, Firefox). 3. You should be testing this file as below: 4. 5. Use Borland Delphi 8 edition for compiling RSA Key generator souce code. Run and compile all source code files(Main.pas, BigMath.pas, RSA.pas)before it can execute RSAkeygenerator(main program). After run “RSAKeyGenerator” execution file, you should testing this file as below: Figure 7. RSA Key Generator Testing for generating new RSA key 6. In order to secure RSA Key Generator Testing(figure 6), editing this source code by using Notepad or HTML editor. Add the following JavaScript lines as below: setMaxDigits; // Put this statement in your code to create a new RSA key with these parameters key = new RSAKeyPair( "3", "18e78c00696284b3923a6d7401aee5b", "255b52009e13c7108d7b57f0a764527" ); 7. Repeat testing “RSA Key generator testing file”. Done it. This above implementation of the RSA key generator in PRNG’s application. On the other hand, according to “A novel dynamic model of pseudo random number generator”[20],in his paper chaotic map equation.(refer to [20]) is used to design a new PRNG algorithm. 12 x ( x , α ) = t a n ( N a r c t a n x ) [14] n n + 1 2 α Our future research can extend the above further studies for advance mathematics in chaotic functions theory and an improved watermarking method based on double random phase encoding technique[16] . Furthermore, according to “Robust Hash Functions for Digital Watermarking”[15], in his paper explained generates the digital watermark from a pseudo-random Gaussian sequence. The PRNG then generates a pseudo-random sequence ξ(i) of a desired length (determined by the particular watermarking technique) Figure 6. The user interface of RSA Key Generator Testing ( i ) P R N G ( K B i b b . . . b ( i ) ( i ) [15] 1 ( i ) q 2 In the expression above the symbol denotes concatenation. The final Gaussian sequence η N(0,1) is obtained by summing up ξ(i) for all i and normalizing: () i 3 1 N i N [15] Our future research can extend the above further studies for double hash function for text based digital watermarking. Figure 8. Digital watermarking tool V. FURTHER MODIFICATION AND IMPROVEMENT A. The modification and improvement of PRNG based on an open source RSA algorithms i) On RSA key Generator Testing source code file, we edited a new RSA key pair statement. Due to perform RSA Key Generator Testing, it generating new RSA public key and private key. It always keep changing a new RSA public key and private key after done repeatedly RSA Key Generator Testing. ii) Due to speed performance constraint, modified maximum to 2048-bits RSA key(Common Cipher strength 128-bit keys). So it can faster speed of encryption and accuracy performance. iii) Due to RSA based PRNG encryption and decryption, PRNG random bit sequence made its strengthen the security of protecting data. B. The Modification and improvement of text based watermarking based on an open source Watermarking algorithms i)Semantic techniques is used for text based watermarking techniques. The semantic watermarking schemes focus on using the semantic structure of text to embed the watermark, so faster speed and accuracy embedded the text contents. ii)We edited open source watermarking algorithms, we add up RSA based PRNG algorithms embedded with text based watermarking algorithms. Nobody knows it combined PRNG random bit sequence embedded with text watermarking algorithms. iii)After compiled RSA key Generator Testing, it generating Public key and Private key. Then put a public key in text based watermarking pool in figure 8. Invisibility and erase hidden data, due to PRNG random bit sequence. it makes a hacker hard to predict or crack it public key. This paper also developed an experimental tool with JAVA on windows according to the above embedding and extracting algorithm for watermarking. The user interface is shown in figure 8 below. VI. CONCLUSIONS In conclusion, this paper proposed a text based watermarking algorithm based on Pseudo-Random Number Generator(PRNG) for cryptography application. The paper has also reported the experimental results shows that proposed method has good invisibility and robustness to resist deletion, modification attack, etc. Moreover, this algorithm can also be applied in the information hiding area through cloud computing, as the embedding method in this paper has large information embedding capacity, which can be used for secret communication of confidential information. The work of this paper will give a help for further research direction as the following. Our future research can extend further studies for advance mathematics in chaotic functions theory[14]. Further improvement watermarking method based on double random phase encoding technique[16]. Our future research can extend further studies for double hash function for text based digital watermarking[15]. It is possible to use these generator to provide PRNG random bit sequences needed for highly parallel application such as parallel grid computing, parallel genetic programming, parallel cryptography, and parallel computation analysis. ACKNOWLEDGMENTS C..H. Lew wishes to express his gratitude to Dr. Woo and Dr. Ng as my PhD thesis supervisor for his valuable discussions on the subject matter of the paper. Mr. Lew Chee Hon obtained his Master of Computer Science from Silicon Valley University, USA in 2004. Currently, he is a PhD candidate at University of Malaya, also he also working as IT lecturer at International College in China. His research areas include Pseudo-random Number Generator, Digital Watermarking and Cryptography. He is also an affiliate member of British Computer Society and ACM since 2010, also IEEE member and IAENG member in 2012. REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] I. J. Cox, M. L. Miller, and J. A. Bloom, Digital Watermarking,Morgan Kaufmann Publishers, 2002. Manpreet Kaur,Sonika Jindal,Sunny Behal,A Study Of Digital Image Watermarking, International Journal of Research in Engineering & Applied Sciences, Volume 2, Issue 2 (February 2012) Chaitin,G.J:Randomness and mathematical proof. Sci. Amer ,1975, 232:47-52. B.A.Wichmanna, I.D. Hill, Generating good pseudo-random numbers, Computational Statistics & Data Analysis 51 (2006) 1614 – 1622 John Kelsey, Bruce Schneier, David Wagner, Chris Hall, Cryptanalytic Attacks on Pseudorandom Number Generators, Fast Software Encryption, 5th International Workshop Proceedings, FSE 1998, Paris, France. Bellare, Mihir; Rogaway, Phillip, "Introduction". Introduction to Modern Cryptography. (21 September 2005). p. 10. J Menezes, PC van Oorschot, and SA Vanstone, Handbook of Applied Cryptography ISBN 0-8493-8523-7. D.Eastlake, S.Crocker and J.Schiller, RFC 1750: Randomness Recommendation for Security, Internet Activies Board,1994. [9] [10] [11] [12] [13] [14] [15] [16] Jiezhao Peng, Qi Wu, Research and Implementation of RSA Algorithm in Java, International Conference on Management of e-Commerce and eGovernment, 2009. Zunera Jalil and Anwar M. Mirza, Text Watermarking Using Combined Image-plus-Text Watermark, Second International Workshop on Education Technology and Computer Science in 2010. Zunera Jalil, M. Arfan Jaffar and Anwar M. Mirza, A Novel Text Watermarking Algorithm Using Image Watermark, International Journal of Innovative Computing, Information and Control ,Volume 7, Number 3, March 2011 Alfred Menezes, Paul van Oorschot, Scott Vanstone,Handbook of Applied Cryptography (Discrete Mathematics and Its Applications) , CRC Press; 1996 Bruce Schneier, Applied Cryptography: Protocol, Algorithms, and source code in C, John Wiley & Sons, Inc. 1996 S. Behnia,A. Akhavanb, A. Akhshani, A. Samsudin, A novel dynamic model of pseudo random number generator, Journal of Computational and Applied Mathematics 235 (2011) 3455–3463 Jiri Fridrich, Miroslav Goljan, Robust Hash Functions for Digital Watermarking, Proceeding of International conference on Information Technology: Coding and Computing, 2000. S. Behnia, A. Akhavan, A. Akhshani, A. Samsudin, An improved watermarking method based on double random phase encoding technique , Journal of Computational and Applied Mathematics 235 (2011) 3455–3463