Question

Given the following Python script. import base64 secret_data = "Malware, you can run but you can't...

Given the following Python script.

import base64

secret_data = "Malware, you can run but you can't hide"

b32encoded_data=base64.b32encode(secret_data.encode('utf-8'))

b64encoded_data=base64.b64encode(secret_data.encode('utf-8'))

a85encoded_data=base64.a85encode(secret_data.encode('utf-8'))

Write the value of the following variables:

  1. b32encoded_data
  2. b64encoded_data
  3. a85encoded_data

Homework Answers

Answer #1

Code:

# importing the package
import base64

# message to encode
secret_data = "Malware, you can run but you can't hide"

# encoding messages in different encodings using base64 package
b32encoded_data=base64.b32encode(secret_data.encode('utf-8'))
b64encoded_data=base64.b64encode(secret_data.encode('utf-8'))
a85encoded_data=base64.a85encode(secret_data.encode('utf-8'))

# to get the value we print the data in the variabels
print('Data in variable "b32encoded_data":', b32encoded_data)
print('Data in variable "b64encoded_data":', b64encoded_data)
print('Data in variable "a85encoded_data":', a85encoded_data)

Data in variable "b32encoded_data": b'JVQWY53BOJSSYIDZN52SAY3BNYQHE5LOEBRHK5BAPFXXKIDDMFXCO5BANBUWIZI='
Data in variable "b64encoded_data": b'TWFsd2FyZSwgeW91IGNhbiBydW4gYnV0IHlvdSBjYW4ndCBoaWRl'
Data in variable "a85encoded_data": b'9jqj^@<,p1+F.mJ+Ceht+EDUB+C]J8+F.mJ+Ceht-ZgJEBk1c'

FOR HELP PLEASE COMMENT.
THANK YOU

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Consider the following python script mt_q2.py, which defines the function called now(): #!/usr/bin/env python3 # program:...
Consider the following python script mt_q2.py, which defines the function called now(): #!/usr/bin/env python3 # program: mt_q2.py import os def now():     p = os.popen('date +%Y%m%d')     today = p.read().strip()     return today if __name__ == '__main__':     print(now()) Asnwer the following questions: (a) What type of object will be returned by the now() function? (b) If you run the above Python script "python3 mt_q2.py" on a system with real-time clock on Oct 16, 2019 at 10:00 am, what will...
The first script you need to write is login.sh, a simple script that you might run...
The first script you need to write is login.sh, a simple script that you might run when you first log in to a machine. We'll expand this script later, but for now it should include your name, username, hostname, current directory, and the current time. Here is some sample output to help guide you. Note that the bolded lines that start with "[user@localhost ~]$" are the terminal prompts where you type in a command, not part of the script. Of...
FYI DB=database_Streaming_Service_GoFlix; I am running the following script to connect through python: =========================================================== import pyodbc conn...
FYI DB=database_Streaming_Service_GoFlix; I am running the following script to connect through python: =========================================================== import pyodbc conn = pyodbc.connect("Driver={ODBC Driver 17 for SQL Server};"                       "Server=test;"                       "Database=database_Streaming_Service_GoFlix;"                       "Trusted_Connection=yes;") cursor = conn.cursor() cursor.execute('SELECT * FROM database_Streaming_Service_GoFlix') for row in cursor:     print('row = %r' % (row,)) ======================================== Output: Traceback (most recent call last): File "C:\Users\test\AppData\Local\Programs\Python\Python39\Scripts\db_connect.py", line 10, in <module>     cursor.execute('SELECT * FROM database_Streaming_Service_GoFlix') pyodbc.ProgrammingError: ('42S02', "[42S02] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid object name 'database_Streaming_Service_GoFlix'. (208) (SQLExecDirectW)") =====================================================...
The below code will create a data fram for you. You need to first run the...
The below code will create a data fram for you. You need to first run the below code and then answer the following questions. # RUN THIS CELL AFTER ADDING YOUR STUDENT NUMBER import pandas as pd import numpy as np my_student_number = np.random.seed(my_student_number) df = pd.DataFrame ({'action': ['BUY']*4+['SELL']*4,                     'A': np.random.randint(20,45,8),                     'B': np.random.randint(50,100,8),                     'C': np.random.randint(110,140,8)}) The above df holds the buy/sell prices of three diferent stocks, A, B, and C recorded over a day. By assuming that you have already...
You will utilize your Python environment to derive structure from unstructured data. You will utilize the...
You will utilize your Python environment to derive structure from unstructured data. You will utilize the given data set. Using this data set, you will create a text analytics Python application that extracts themes from each comment using term frequency–inverse document frequency (TF–IDF) or simple word counts. For the deliverable, provide your Python file and a .csv with your results added as a column to the original data set. * I am unable to provide the data set itself, as...
10. Which of the following statements about python dictionary is correct? A. You can have different...
10. Which of the following statements about python dictionary is correct? A. You can have different types of data as keys in a dictionary. B. You can have variables as keys in a dictionary. C. The values (key-value pairs) in a dictionary must be the types of int or float. D. You cannot have a list as key in a dictionary.
In the Python script, you calculated a 95% confidence interval for the average relative skill of...
In the Python script, you calculated a 95% confidence interval for the average relative skill of all teams in the league during the years of your team. Additionally, you calculated the probability that a given team in the league has a relative skill level less than that of the team that you picked. Info here: Confidence Level (%) Confidence Interval 95% 2013 to 2015 – 1502.02 (Rounded) 95% 2013 to 2015 – 1502.02, 1507.18 (Unrounded) **Probability a team has Average...
Save your select statements as a script. Place the semicolon at the end of each SQL...
Save your select statements as a script. Place the semicolon at the end of each SQL statement. Please number your select statements from 1 to 8 in your script and comment out each number. Include your name and student number as a comment at the top of your script. The name of the script has to be Assignment1_JohnSmith. Instead of JohnSmith use your First Name and Last Name. Upload your script trough Blackboard. Use SQL Developer to create the My...
Assume the earth’s continents drift about 1.25 centimeters per year. Write a Python program/script using a...
Assume the earth’s continents drift about 1.25 centimeters per year. Write a Python program/script using a for-loop to display the total number of centimeters that the continents will have moved each year for the next 50 years. a. What tasks need to be repeated (write in words)? b. What is the start point of the loop and why? c. What is the end point of the loop and why? d. What is the start value for the initial drift and...
PYTHON : Create a Email Address Parser (* Please do make comments*) Often times, you may...
PYTHON : Create a Email Address Parser (* Please do make comments*) Often times, you may be given a list of raw email addresses and be asked to generate meaningful information from such a list. This project involves parsing such a list and generating names and summary information from that list. The script, eparser.py, should: Open the file specified as the first argument to the script (see below) Read the file one line at a time (i.e., for line in...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT