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 20:00
Which location-sharing service offers items for users as a gaming component and also allows them to collectively link their check-ins to publish a trip? a. whrrl b. buzzd c. foursquare (this option is wrong i already tried) d. gowalla for plato
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
Alex’s family members live in different parts of the world. they would like to discuss the wedding plans of one of their distant relatives. however, alex wants all the family members to talk to each other simultaneously so that they can make decisions quickly. which mode of internet communication should they use? a. blog b. email c. wiki d. message board e. instant messaging
Answers: 2
question
Computers and Technology, 23.06.2019 07:30
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
The song about casey jones a railroad engineer who gives his life on the job would most likely gall under the folk song category of? a-work song b-nonsense song c-religious song d-ballad
Answers: 1
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
Advanced Placement (AP), 28.07.2019 02:00
question
History, 28.07.2019 02:00
Questions on the website: 13722367