IN JAVA: General explanation: For your implementation you will perform 16 rounds. You will specify a 9 bit key. A 12-bit

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

IN JAVA: General explanation: For your implementation you will perform 16 rounds. You will specify a 9 bit key. A 12-bit

Post by answerhappygod »

IN JAVA:
General explanation:
For your implementation you will perform 16 rounds. You willspecify a 9 bit key. A 12-bit value is passed intoa simplified DES algorithm and is immediately split into two6-bit values. Since the ASCII system represents characters as 8-bitvalues we must pass 1½ ASCII characters into our system. Sincethere are no ½ characters we will process 3 characters (24 bits) ata time calling the system twice (12 bits each call.)
What to do:
Write a function that receives a sequence of ASCII characters(this can be a Java String object or an array of byte primitives,your choice), breaks it up into 3- character subsequences. Each3-character subsequence is then split into two 12-bit values. Each12-bit value will be split into two 6-bit values by your Simple DESsystem. The result will be the cipher (encrypted) or plain(decrypted) text depending on which “direction” you are processing.If the input data length is not a multiple of 3 you should pad itwith null characters (0).
Demonstrate your system by encrypting and decrypting thefollowing character strings:
• ABC
• ABCD
• ABCDE
• The cat sleeps on the tree.
For example, your code may look as such:
short key = 0b010101010
byte cipher[] = encrypt(“ABC”.getBytes(), key);
byte plain[] = decrypt(cipher, key);
for (byte b : plain) {
System.out.print(b + “ “);
}
Do this for the 4 specified test strings.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply