subject

Use the instructor provided xor code to implement a scheme that allows you to encrypt and decrypt some data using symmetric encryption principles.

-you can implement any scheme that you want. either one of the schemes discussed in the class or a new one that you designed on your own.

-the key aspect is that you should generate several blocks from the input and you should do several rounds of encoding.

-implement the python code and show your results.

here is the provided code:

## xor script

from os import urandom



def genkey(length):
return bytearray(urandom(lenght))



def encrypt(plaintext, key):
return bytearray([ ord(plaintext[i]) ^ key[i] for i in range(len(



def main():
mymessage = "this is the plain text"
key = genkey
cipher = encrypt(mymessage, key)
print str(cipher)
decrypted_message = decrypt(cipher, key)
print decrypted_message
if decrypted (encrypt(mymessage, key) , key ) == mymessage:
print "it works"
else:
print "somthing failed"

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:40
For this assignment you have to write a c program that will take an infix expression as input and display the postfix expression of the input. after converting to the postfix expression, the program should evaluate the expression from the postfix and display the result. what should you submit? write all the code in a single file and upload the .c file. compliance with rules: ucf golden rules apply towards this assignment and submission. assignment rules mentioned in syllabus, are also applied in this submission. the ta and instructor can call any students for explaining any part of the code in order to better assess your authorship and for further clarification if needed. problem: we as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in computer's language, however, it is preferred to have the operators on the right side of the operands, ie. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix write a program that takes an "infix" expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % ( example infix expression: (7-3)/(2+2) postfix expression: 7 3 2 2 result: rubric: 1) if code does not compile in eustis server: 0. 2) checking the balance of the parenthesis: 2 points 3) incorrect postfix expression per test case: -2 points 4) correct postfix but incorrect evaluation per test case: -i points 5) handling single digit inputs: maximum 11 points 6) handling two-digit inputs: 100 percent (if pass all test cases)
Answers: 3
question
Computers and Technology, 22.06.2019 17:00
Match the following. 1. show grouping of word processing tasks that can be performed quick access toolbar 2. shortcut location for commonly used elements scroll bars 3. organized commands used to modify documents ribbon 4. used to align and measure content in a word screen zoom bar 5. vertical and horizontal bars that are used to navigate through a document contextual tabs 6. displays the name of the document in use ruler 7. allows users to enlarge or shrink a visual of a word document title bar
Answers: 2
question
Computers and Technology, 22.06.2019 18:30
All of the following are characteristics that must be contained in any knowledge representation scheme except
Answers: 3
question
Computers and Technology, 23.06.2019 08:00
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
You know the right answer?
Use the instructor provided xor code to implement a scheme that allows you to encrypt and decrypt so...
Questions
question
Mathematics, 19.11.2019 02:31
Questions on the website: 13722360