For this assignment, you will use sed, bash, and the other utilities you have used in class to…

For this assignment, you will use sed, bash, and the other utilities you have used in class to create a program for use by a municipality for both redacting sensitive information from internal communications, as well as simplifying and standardizing the format of these documents prior to their release and circulation. Your program should take the names of one or more files that are to be redacted as command line arguments. This assignment requires only sed, bash, and the other utilities used so far in class. Do not use awk, Python, or any other languages/utilities. Redaction and Substitution Rules For all files specified, the following changes should be made in place. No other changes should be made to the file. • Driver’s License numbers begin with xx DL, where xx is a two-letter state code identifying the origin of the issuing state. Following this code is a space character, then a license number composed of at least 6 digits in length. For example, the following are all valid driver’s license numbers: – TXDL 12345678 – VADL 123456 – WADL 1234567890 These numbers should be redacted by simply replacing the license number with a sequence of six X characters. • Credit Card Numbers Credit card numbers must be redacted, but it is desirable that the censored text still retain information suitable for the identification of both the type of card (i.e., the issuer), as well as its last four digits. Each card network specifies a unique first digit to the cards they issue, and typically contain 16 digits in total. American Express is an exception to this, in which the second number can only be a 4 or a 7, and the total number of digits is only 15. In summary: – Visa cards: Begin with a 4 and have 16 digits – Master Cards: Begin with a 5 and have 16 digits – American Express cards: Begin with a 3, followed by a 4 or a 7, and have 15 digits – Discover cards: Begin with a 6 and have 16 digits Card number data should be redacted as in the following examples. Note that 16 digit numbers may or may not be separated into groups of four using hyphens – this is optional. Hyphenation of Assignment 2: sed Page 1 of 5 American Express cards into sections of 4, 6, and 5 digits is similarly common, and also optional. Examples of the expected substitutions for each card type are as follows: – 5441-4839-9284-3129 ? MC-3129 – 3770-123456-78900 ? AMEX-8900 – 6093-2033-0662-5389 ? DISC-5389 – 4291723799801302 ? VISA-1302 • Texas Vehicle License Plate numbers should be similarly obliterated. Texas vehicle plates appear in one of two formats, but both will be written with the letters TX and an optional space preceding them. The first type is six alphanumeric characters, optionally separated by a hyphen in the middle. The second type begins with three alphabetic characters, followed by four digits, again optionally separated by a hyphen. Examples of valid type one Texas license plate numbers are: – TX 32P9ZP – TX 32P-9ZP – TX32P9ZP – TX32P-9ZP Examples of valid type two Texas license plate numbers are: – TX JTK8791 – TX JTK-8791 – TXJTK8791 – TXJTK-8791 These numbers should be redacted by simply replacing the license plate number with a sequence of six X characters. • Current Date Placeholder The document authors may use the shorthand symbol in order to insert the current date (i.e., today’s date). Regardless of the date on which your script is run, this placeholder should be updated with the correct current date. • Municipality Name Placeholder The authors of these documents may use the shorthand symbol in order to designate the full name of their municipality. Any such references should be replaced with the full name: City of Gainsville, Florida. Assignment 2: sed Page 2 of 5 Example Original redactme.txt: 1 2 Date : 3 T i t l e : Memorandum #139 4 5 Dear s t a f f : 6 7 Memorandum #139 ha s been amended a s f o l l o w s , i n a c c o r d a n c e w i t h t h e 8 u p da te d em pl oyee o p e r a t i o n s and p u r c h a s i n g p o l i c y * : 9 10 The o n l y em pl o y e e s a u t h o r i z e d t o o p e r a t e v e h i c l e #102 ( l i c e n s e p l a t e 11 TX JTK8791 ) , v e h i c l e #162 ( l i c e n s e p l a t e TX 32P-9ZP) , and v e h i c l e #262 12 ( l i c e n s e p l a t e TX AJC-6244) a r e t h o s e em pl o y e e s who p o s s e s s t h e f o l l o w i n g 13 d r i v e r ‘ s l i c e n s e s : 14 15 TXDL 02851332 16 TXDL 00748892 17 VADL 590401 18 FLDL 104281332 19 20 F u r t h e r , u sa g e o f c i t y c r e d i t c a r d s w i l l be s t r i c t l y l i m i t e d t o t h e 21 f o l l o w i n g d e p a r tm e n t a l ca r d s , u n t i l f u r t h e r n o t i c e : 22 23 5441-4839-9284-3129 24 3770-123456-78900 25 6093-2033-0662-5389 26 4291723799801302 27 28 Thank you , 29 Mgmt 30 31 * P o l i c y r e v i s i o n da t e 2/1/13 ( o r i g i n a l l y p a s s e d 7 / 1 3 / 9 2 ) . Redacted Version of redactme.txt: 1 C i t y o f G a i n s v i l l e , F l o r i d a 2 Date : 09/19/2019 3 T i t l e : Memorandum #139 4 5 Dear s t a f f : 6 7 Memorandum #139 ha s been amended a s f o l l o w s , i n a c c o r d a n c e w i t h t h e 8 u p da te d em pl oyee o p e r a t i o n s and p u r c h a s i n g p o l i c y * : 9 10 The o n l y em pl o y e e s a u t h o r i z e d t o o p e r a t e v e h i c l e #102 ( l i c e n s e p l a t e 11 TX XXXXXX) , v e h i c l e #162 ( l i c e n s e p l a t e TX XXXXXX) , and v e h i c l e #262 12 ( l i c e n s e p l a t e TX XXXXXX) a r e t h o s e em pl o y e e s who p o s s e s s t h e f o l l o w i n g 13 d r i v e r ‘ s l i c e n s e s : 14 Assignment 2: sed Page 3 of 5 15 TXDL XXXXXX 16 TXDL XXXXXX 17 VADL XXXXXX 18 FLDL XXXXXX 19 20 F u r t h e r , u sa g e o f c i t y c r e d i t c a r d s w i l l be s t r i c t l y l i m i t e d t o t h e 21 f o l l o w i n g d e p a r tm e n t a l ca r d s , u n t i l f u r t h e r n o t i c e : 22 23 MC-3129 24 AMEX-8900 25 DISC-5389 26 VISA-1302 27 28 Thank you , 29 Mgmt 30 31 * P o l i c y r e v i s i o n da t e 2/1/13 ( o r i g i n a l l y p a s s e d 7 / 1 3 / 9 2 ) . Script Execution Your program should be invoked through a single bash file (see below) with the filename(s) containing the sensitive data optionally provided as argument(s) or via standard input. Examples: $ assign2.bash redactme.txt $ assign2.bash < redactme.txt $ cat redactme.txt | assign2.bash Assignment Data A sample input file can be found in: /usr/local/courses/ssilvestro/cs3424/Fall21/assign2 When using this data, remember that your will be made to overwrite the files. Be sure to make a backup of the files and restore them every time you run the script. Script Files Your program should consist of exactly two files: • assign2.bash – the main file which is initially invoked • Exactly one .sed file which is used for a sed invocation run in assign2.bash.
Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!