SlideShare a Scribd company logo
1 of 2
Download to read offline
Python help:
You will be writing an encryption program for an IT company. Your program should give the
option to either encrypt or decrypt a file of passwords. The encryption option should take each
password in the file, encrypt it, and output the encrypted contents to a new file. The decryption
process should reverse a previously encrypted file and output the original message to a new file.
File to use for testing: passwords.txt.
File contains:
PQERYT
NSBEMD
WPRZQY
ARITOU
Additional Information:
Encryption: To encrypt the file, you should start by reading through the file, character by
character, and place each character into a list. Spaces and punctuation are considered characters.
You should then change each character in the list into its ASCII value and subtract its index from
the value. For example, with the password: PQERYT, the capital P would be encrypted as 80 (its
ASCII code of 80 minus 0, its index number in the list) and the Q would be encrypted as 80 (its
ASCII code of 81 minus 1, its index number in the list). Finally, take the list and concatenate all
the values together into one string variable with a period between each value. For example, the
password PQERYT, the encrypted output file would contain: 80.80.67.79.85.79.4. (The 4 is the
newline character at the end of the password in the file).
Decryption: To decrypt the file, you should start by reading through the input file. Next, take the
string and create a list by using the split() function with the periods as the delimiter. When you
create the list, there will be an empty string placed at the end of the list that will need to be
removed. Finally, take the new list, add each value by its index and then convert that resulting
ASCII number into its appropriate character. Example: 80.80.67.79.85.79.4.
[80,80,67,79,85,79,4] PQERYTn Your Task:
Your instructor is very particular regarding how this assignment will be completed so you must
follow the guidelines listed below exactly. You will need to define two functions with the
following criteria:
A function named encrypt() with no parameters. Within the function, the user should be
prompted to enter the input file name and the output file name. The function will then read in the
data from the input file, encrypt the information, and output the results of the encrypted message
to the output file.
A function named decrypt() also has no parameters. Within the function, the user should be
prompted to enter the input file name and the output file name. The function will then read in the
encrypted data from the input file, reverse the encryption process, and output the decrypted
message to the output file. The program should prompt the user to choose whether they want to
encrypt or decrypt a file or exit the program.

More Related Content

Similar to Python help- You will be writing an encryption program for an IT compa.pdf

String & path functions in vba
String & path functions in vbaString & path functions in vba
String & path functions in vbagondwe Ben
 
Class notes(week 5) on command line arguments
Class notes(week 5) on command line argumentsClass notes(week 5) on command line arguments
Class notes(week 5) on command line argumentsKuntal Bhowmick
 
Engineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptxEngineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptxhardii0991
 
Code In PythonFile 1 main.pyYou will implement two algorithms t.pdf
Code In PythonFile 1 main.pyYou will implement two algorithms t.pdfCode In PythonFile 1 main.pyYou will implement two algorithms t.pdf
Code In PythonFile 1 main.pyYou will implement two algorithms t.pdfaishwaryaequipment
 
Arrays and function basic c programming notes
Arrays and function basic c programming notesArrays and function basic c programming notes
Arrays and function basic c programming notesGOKULKANNANMMECLECTC
 
Class notes(week 5) on command line arguments
Class notes(week 5) on command line argumentsClass notes(week 5) on command line arguments
Class notes(week 5) on command line argumentsKuntal Bhowmick
 
What is Data Types and Functions?
What is Data Types and Functions?What is Data Types and Functions?
What is Data Types and Functions?AnuragSrivastava272
 
Using Array Approach, Linked List approach, and Delete Byte Approach.pdf
Using Array Approach, Linked List approach, and Delete Byte Approach.pdfUsing Array Approach, Linked List approach, and Delete Byte Approach.pdf
Using Array Approach, Linked List approach, and Delete Byte Approach.pdffms12345
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonMaheshPandit16
 
Chapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer ScienceChapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer ScienceKrithikaTM
 
Educational Objectives After successfully completing this assignmen.pdf
Educational Objectives After successfully completing this assignmen.pdfEducational Objectives After successfully completing this assignmen.pdf
Educational Objectives After successfully completing this assignmen.pdfrajeshjangid1865
 
C UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDYC UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDYRajeshkumar Reddy
 
It’s sometimes useful to make a little language for a simple problem.pdf
It’s sometimes useful to make a little language for a simple problem.pdfIt’s sometimes useful to make a little language for a simple problem.pdf
It’s sometimes useful to make a little language for a simple problem.pdfarri2009av
 
intro unix/linux 05
intro unix/linux 05intro unix/linux 05
intro unix/linux 05duquoi
 
Article link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxArticle link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxfredharris32
 
Learn Python The Hard Way Presentation
Learn Python The Hard Way PresentationLearn Python The Hard Way Presentation
Learn Python The Hard Way PresentationAmira ElSharkawy
 

Similar to Python help- You will be writing an encryption program for an IT compa.pdf (20)

String & path functions in vba
String & path functions in vbaString & path functions in vba
String & path functions in vba
 
Python Objects
Python ObjectsPython Objects
Python Objects
 
Class notes(week 5) on command line arguments
Class notes(week 5) on command line argumentsClass notes(week 5) on command line arguments
Class notes(week 5) on command line arguments
 
Engineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptxEngineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptx
 
Code In PythonFile 1 main.pyYou will implement two algorithms t.pdf
Code In PythonFile 1 main.pyYou will implement two algorithms t.pdfCode In PythonFile 1 main.pyYou will implement two algorithms t.pdf
Code In PythonFile 1 main.pyYou will implement two algorithms t.pdf
 
Arrays and function basic c programming notes
Arrays and function basic c programming notesArrays and function basic c programming notes
Arrays and function basic c programming notes
 
Class notes(week 5) on command line arguments
Class notes(week 5) on command line argumentsClass notes(week 5) on command line arguments
Class notes(week 5) on command line arguments
 
What is Data Types and Functions?
What is Data Types and Functions?What is Data Types and Functions?
What is Data Types and Functions?
 
Using Array Approach, Linked List approach, and Delete Byte Approach.pdf
Using Array Approach, Linked List approach, and Delete Byte Approach.pdfUsing Array Approach, Linked List approach, and Delete Byte Approach.pdf
Using Array Approach, Linked List approach, and Delete Byte Approach.pdf
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Chapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer ScienceChapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer Science
 
Educational Objectives After successfully completing this assignmen.pdf
Educational Objectives After successfully completing this assignmen.pdfEducational Objectives After successfully completing this assignmen.pdf
Educational Objectives After successfully completing this assignmen.pdf
 
Aggregate.pptx
Aggregate.pptxAggregate.pptx
Aggregate.pptx
 
C UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDYC UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDY
 
It’s sometimes useful to make a little language for a simple problem.pdf
It’s sometimes useful to make a little language for a simple problem.pdfIt’s sometimes useful to make a little language for a simple problem.pdf
It’s sometimes useful to make a little language for a simple problem.pdf
 
intro unix/linux 05
intro unix/linux 05intro unix/linux 05
intro unix/linux 05
 
Article link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxArticle link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docx
 
Learn Python The Hard Way Presentation
Learn Python The Hard Way PresentationLearn Python The Hard Way Presentation
Learn Python The Hard Way Presentation
 
Lecture 3.pptx
Lecture 3.pptxLecture 3.pptx
Lecture 3.pptx
 
Python for Beginners
Python  for BeginnersPython  for Beginners
Python for Beginners
 

More from ChristopherkUzHunter

Q3-You crossed a female fly with the eyeless mutation for eye shape bu.pdf
Q3-You crossed a female fly with the eyeless mutation for eye shape bu.pdfQ3-You crossed a female fly with the eyeless mutation for eye shape bu.pdf
Q3-You crossed a female fly with the eyeless mutation for eye shape bu.pdfChristopherkUzHunter
 
Q3 (10)- A program creates a queue- The program takes array of user na.pdf
Q3 (10)- A program creates a queue- The program takes array of user na.pdfQ3 (10)- A program creates a queue- The program takes array of user na.pdf
Q3 (10)- A program creates a queue- The program takes array of user na.pdfChristopherkUzHunter
 
Q2-10- You are studying how a species of snake might respond to climat.pdf
Q2-10- You are studying how a species of snake might respond to climat.pdfQ2-10- You are studying how a species of snake might respond to climat.pdf
Q2-10- You are studying how a species of snake might respond to climat.pdfChristopherkUzHunter
 
Q2-8- Which of the following is an example of adaptation- A city-dwell.pdf
Q2-8- Which of the following is an example of adaptation- A city-dwell.pdfQ2-8- Which of the following is an example of adaptation- A city-dwell.pdf
Q2-8- Which of the following is an example of adaptation- A city-dwell.pdfChristopherkUzHunter
 
Q2 (10)- A linked-list based stack S has few elements in it as shown b.pdf
Q2 (10)- A linked-list based stack S has few elements in it as shown b.pdfQ2 (10)- A linked-list based stack S has few elements in it as shown b.pdf
Q2 (10)- A linked-list based stack S has few elements in it as shown b.pdfChristopherkUzHunter
 
Q1-26- The social bacteria M- xanthus coordinate group attacks on othe.pdf
Q1-26- The social bacteria M- xanthus coordinate group attacks on othe.pdfQ1-26- The social bacteria M- xanthus coordinate group attacks on othe.pdf
Q1-26- The social bacteria M- xanthus coordinate group attacks on othe.pdfChristopherkUzHunter
 
Q What are externalities and examples of positive and negative What is.pdf
Q What are externalities and examples of positive and negative What is.pdfQ What are externalities and examples of positive and negative What is.pdf
Q What are externalities and examples of positive and negative What is.pdfChristopherkUzHunter
 
python Your program should perform the followings-.pdf
python Your program should perform the followings-.pdfpython Your program should perform the followings-.pdf
python Your program should perform the followings-.pdfChristopherkUzHunter
 
Q What is the Coase theorem and what does it tell us about externaliti.pdf
Q What is the Coase theorem and what does it tell us about externaliti.pdfQ What is the Coase theorem and what does it tell us about externaliti.pdf
Q What is the Coase theorem and what does it tell us about externaliti.pdfChristopherkUzHunter
 
Pythagorean Theorem c2-a2+b2 Triangles demo- - define structure for ke.pdf
Pythagorean Theorem c2-a2+b2 Triangles demo- - define structure for ke.pdfPythagorean Theorem c2-a2+b2 Triangles demo- - define structure for ke.pdf
Pythagorean Theorem c2-a2+b2 Triangles demo- - define structure for ke.pdfChristopherkUzHunter
 
Q- the power of the president to veto legislation and the power of the.pdf
Q- the power of the president to veto legislation and the power of the.pdfQ- the power of the president to veto legislation and the power of the.pdf
Q- the power of the president to veto legislation and the power of the.pdfChristopherkUzHunter
 
Q1- (12 pts) (a) Is it possible that an event E is independent of E (i.pdf
Q1- (12 pts) (a) Is it possible that an event E is independent of E (i.pdfQ1- (12 pts) (a) Is it possible that an event E is independent of E (i.pdf
Q1- (12 pts) (a) Is it possible that an event E is independent of E (i.pdfChristopherkUzHunter
 
Public administration related question 1- A central theme in the post.pdf
Public administration related question  1- A central theme in the post.pdfPublic administration related question  1- A central theme in the post.pdf
Public administration related question 1- A central theme in the post.pdfChristopherkUzHunter
 
q- M be the Deterministic Finite Antomata (DFA) show below please answ.pdf
q- M be the Deterministic Finite Antomata (DFA) show below please answ.pdfq- M be the Deterministic Finite Antomata (DFA) show below please answ.pdf
q- M be the Deterministic Finite Antomata (DFA) show below please answ.pdfChristopherkUzHunter
 
Q- A resident has been diagnosed with a strote which action would the.pdf
Q- A resident has been diagnosed with a strote which action would the.pdfQ- A resident has been diagnosed with a strote which action would the.pdf
Q- A resident has been diagnosed with a strote which action would the.pdfChristopherkUzHunter
 
Python version change I use a MacBook version 12-1 I want to change.pdf
Python version change  I use a MacBook version 12-1  I want to change.pdfPython version change  I use a MacBook version 12-1  I want to change.pdf
Python version change I use a MacBook version 12-1 I want to change.pdfChristopherkUzHunter
 
Question 2 a) Write a program code to multiply two square matrices usi.pdf
Question 2 a) Write a program code to multiply two square matrices usi.pdfQuestion 2 a) Write a program code to multiply two square matrices usi.pdf
Question 2 a) Write a program code to multiply two square matrices usi.pdfChristopherkUzHunter
 
Question 2 - A two-way set-associative cache has lines of 16 bytes and.pdf
Question 2 - A two-way set-associative cache has lines of 16 bytes and.pdfQuestion 2 - A two-way set-associative cache has lines of 16 bytes and.pdf
Question 2 - A two-way set-associative cache has lines of 16 bytes and.pdfChristopherkUzHunter
 
Question 2 (1 point) Match the term with the best corresponding defini.pdf
Question 2 (1 point) Match the term with the best corresponding defini.pdfQuestion 2 (1 point) Match the term with the best corresponding defini.pdf
Question 2 (1 point) Match the term with the best corresponding defini.pdfChristopherkUzHunter
 
Question 11 (4 points) Which of the following is NOT a primary chara.pdf
Question 11 (4 points)   Which of the following is NOT a primary chara.pdfQuestion 11 (4 points)   Which of the following is NOT a primary chara.pdf
Question 11 (4 points) Which of the following is NOT a primary chara.pdfChristopherkUzHunter
 

More from ChristopherkUzHunter (20)

Q3-You crossed a female fly with the eyeless mutation for eye shape bu.pdf
Q3-You crossed a female fly with the eyeless mutation for eye shape bu.pdfQ3-You crossed a female fly with the eyeless mutation for eye shape bu.pdf
Q3-You crossed a female fly with the eyeless mutation for eye shape bu.pdf
 
Q3 (10)- A program creates a queue- The program takes array of user na.pdf
Q3 (10)- A program creates a queue- The program takes array of user na.pdfQ3 (10)- A program creates a queue- The program takes array of user na.pdf
Q3 (10)- A program creates a queue- The program takes array of user na.pdf
 
Q2-10- You are studying how a species of snake might respond to climat.pdf
Q2-10- You are studying how a species of snake might respond to climat.pdfQ2-10- You are studying how a species of snake might respond to climat.pdf
Q2-10- You are studying how a species of snake might respond to climat.pdf
 
Q2-8- Which of the following is an example of adaptation- A city-dwell.pdf
Q2-8- Which of the following is an example of adaptation- A city-dwell.pdfQ2-8- Which of the following is an example of adaptation- A city-dwell.pdf
Q2-8- Which of the following is an example of adaptation- A city-dwell.pdf
 
Q2 (10)- A linked-list based stack S has few elements in it as shown b.pdf
Q2 (10)- A linked-list based stack S has few elements in it as shown b.pdfQ2 (10)- A linked-list based stack S has few elements in it as shown b.pdf
Q2 (10)- A linked-list based stack S has few elements in it as shown b.pdf
 
Q1-26- The social bacteria M- xanthus coordinate group attacks on othe.pdf
Q1-26- The social bacteria M- xanthus coordinate group attacks on othe.pdfQ1-26- The social bacteria M- xanthus coordinate group attacks on othe.pdf
Q1-26- The social bacteria M- xanthus coordinate group attacks on othe.pdf
 
Q What are externalities and examples of positive and negative What is.pdf
Q What are externalities and examples of positive and negative What is.pdfQ What are externalities and examples of positive and negative What is.pdf
Q What are externalities and examples of positive and negative What is.pdf
 
python Your program should perform the followings-.pdf
python Your program should perform the followings-.pdfpython Your program should perform the followings-.pdf
python Your program should perform the followings-.pdf
 
Q What is the Coase theorem and what does it tell us about externaliti.pdf
Q What is the Coase theorem and what does it tell us about externaliti.pdfQ What is the Coase theorem and what does it tell us about externaliti.pdf
Q What is the Coase theorem and what does it tell us about externaliti.pdf
 
Pythagorean Theorem c2-a2+b2 Triangles demo- - define structure for ke.pdf
Pythagorean Theorem c2-a2+b2 Triangles demo- - define structure for ke.pdfPythagorean Theorem c2-a2+b2 Triangles demo- - define structure for ke.pdf
Pythagorean Theorem c2-a2+b2 Triangles demo- - define structure for ke.pdf
 
Q- the power of the president to veto legislation and the power of the.pdf
Q- the power of the president to veto legislation and the power of the.pdfQ- the power of the president to veto legislation and the power of the.pdf
Q- the power of the president to veto legislation and the power of the.pdf
 
Q1- (12 pts) (a) Is it possible that an event E is independent of E (i.pdf
Q1- (12 pts) (a) Is it possible that an event E is independent of E (i.pdfQ1- (12 pts) (a) Is it possible that an event E is independent of E (i.pdf
Q1- (12 pts) (a) Is it possible that an event E is independent of E (i.pdf
 
Public administration related question 1- A central theme in the post.pdf
Public administration related question  1- A central theme in the post.pdfPublic administration related question  1- A central theme in the post.pdf
Public administration related question 1- A central theme in the post.pdf
 
q- M be the Deterministic Finite Antomata (DFA) show below please answ.pdf
q- M be the Deterministic Finite Antomata (DFA) show below please answ.pdfq- M be the Deterministic Finite Antomata (DFA) show below please answ.pdf
q- M be the Deterministic Finite Antomata (DFA) show below please answ.pdf
 
Q- A resident has been diagnosed with a strote which action would the.pdf
Q- A resident has been diagnosed with a strote which action would the.pdfQ- A resident has been diagnosed with a strote which action would the.pdf
Q- A resident has been diagnosed with a strote which action would the.pdf
 
Python version change I use a MacBook version 12-1 I want to change.pdf
Python version change  I use a MacBook version 12-1  I want to change.pdfPython version change  I use a MacBook version 12-1  I want to change.pdf
Python version change I use a MacBook version 12-1 I want to change.pdf
 
Question 2 a) Write a program code to multiply two square matrices usi.pdf
Question 2 a) Write a program code to multiply two square matrices usi.pdfQuestion 2 a) Write a program code to multiply two square matrices usi.pdf
Question 2 a) Write a program code to multiply two square matrices usi.pdf
 
Question 2 - A two-way set-associative cache has lines of 16 bytes and.pdf
Question 2 - A two-way set-associative cache has lines of 16 bytes and.pdfQuestion 2 - A two-way set-associative cache has lines of 16 bytes and.pdf
Question 2 - A two-way set-associative cache has lines of 16 bytes and.pdf
 
Question 2 (1 point) Match the term with the best corresponding defini.pdf
Question 2 (1 point) Match the term with the best corresponding defini.pdfQuestion 2 (1 point) Match the term with the best corresponding defini.pdf
Question 2 (1 point) Match the term with the best corresponding defini.pdf
 
Question 11 (4 points) Which of the following is NOT a primary chara.pdf
Question 11 (4 points)   Which of the following is NOT a primary chara.pdfQuestion 11 (4 points)   Which of the following is NOT a primary chara.pdf
Question 11 (4 points) Which of the following is NOT a primary chara.pdf
 

Recently uploaded

Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

Python help- You will be writing an encryption program for an IT compa.pdf

  • 1. Python help: You will be writing an encryption program for an IT company. Your program should give the option to either encrypt or decrypt a file of passwords. The encryption option should take each password in the file, encrypt it, and output the encrypted contents to a new file. The decryption process should reverse a previously encrypted file and output the original message to a new file. File to use for testing: passwords.txt. File contains: PQERYT NSBEMD WPRZQY ARITOU Additional Information: Encryption: To encrypt the file, you should start by reading through the file, character by character, and place each character into a list. Spaces and punctuation are considered characters. You should then change each character in the list into its ASCII value and subtract its index from the value. For example, with the password: PQERYT, the capital P would be encrypted as 80 (its ASCII code of 80 minus 0, its index number in the list) and the Q would be encrypted as 80 (its ASCII code of 81 minus 1, its index number in the list). Finally, take the list and concatenate all the values together into one string variable with a period between each value. For example, the password PQERYT, the encrypted output file would contain: 80.80.67.79.85.79.4. (The 4 is the newline character at the end of the password in the file). Decryption: To decrypt the file, you should start by reading through the input file. Next, take the string and create a list by using the split() function with the periods as the delimiter. When you create the list, there will be an empty string placed at the end of the list that will need to be removed. Finally, take the new list, add each value by its index and then convert that resulting ASCII number into its appropriate character. Example: 80.80.67.79.85.79.4. [80,80,67,79,85,79,4] PQERYTn Your Task: Your instructor is very particular regarding how this assignment will be completed so you must follow the guidelines listed below exactly. You will need to define two functions with the following criteria: A function named encrypt() with no parameters. Within the function, the user should be prompted to enter the input file name and the output file name. The function will then read in the data from the input file, encrypt the information, and output the results of the encrypted message to the output file. A function named decrypt() also has no parameters. Within the function, the user should be prompted to enter the input file name and the output file name. The function will then read in the
  • 2. encrypted data from the input file, reverse the encryption process, and output the decrypted message to the output file. The program should prompt the user to choose whether they want to encrypt or decrypt a file or exit the program.