Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is code I'm currently working on learning about ciphers. During/after encryption of the plain text, how would I save the cipher text in hexadecimal?

This is code I'm currently working on learning about ciphers. During/after encryption of the plain text, how would I save the cipher text in hexadecimal? Example and explanation woul be appreciated thank you.

package rccipher;

import java.util.Scanner; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException;

public class RCCipher {

static void output(int disp[]) { char con[]=new char[disp.length]; for(int l=0;l

String text = "In cryptography, RC4 (Rivest Cipher 4 also known as ARC4 or " + " ARCFOUR meaning Alleged RC4) is a stream cipher. While remarkable" + " for its simplicity and speed in software, multiple vulnerabilities" + " have been discovered in RC4, rendering it insecure. It is especially" + " vulnerable when the beginning of the output keystream is not discarded," + " or when nonrandom or related keys are used. Particularly problematic " + " uses of RC4 have led to very insecure protocols such as WEP."; String key; int sbox[] = new int[256]; int kgen[] = new int[256];

Scanner scan = new Scanner(System.in); int temp=0;

System.out.println("ORIGINAL PLAIN TEXT:"); System.out.println(text);

System.out.println(" ENTER KEY:"); key=scan.nextLine(); char ptextc[]=text.toCharArray(); char keyc[]=key.toCharArray(); int cipher[]=new int[text.length()]; int decrypt[]=new int[text.length()]; int plainTexti[]=new int[text.length()]; int keyi[]=new int[key.length()]; for(int i=0;i

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions