76 245
Assignments Done
Successfully Done
In May 2019

Answer to Question #21136 in C# for Abdallah

Question #21136
For encryption, we consider that the formula is: C = P XOR K, where

* C = encrypted code

* P = plain text

* K = key

For decryption the formula is: P = C XOR K. So, your program will try to find K using this formula. The XOR operator is ^.
Expert's answer
using System;
using System.IO;

class Program
public static void Main()
byte C, K, P;
Console.Write("Enter C: ");
C = byte.Parse(Console.ReadLine());
Console.Write("Enter P: ");
P = byte.Parse(Console.ReadLine());

K = (byte)(C ^ P);
Console.WriteLine("K = " + K);

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions