Cryptogram Encoder. Cryptography is used to protect messages from unauthorized v
ID: 3826062 • Letter: C
Question
Cryptogram Encoder. Cryptography is used to protect messages from unauthorized viewers. An algorithm using an encoding key scrambles the letters in a message string, making it unintelligible to anyone not having the key.
A simple encoding algorithm involves substituting one lower case letter for another, e.g., replace each letter in the range ‘a’ to ‘z’ with a different letter in this range. To insure proper decoding, each letter should be used exactly once. A 26 character string is used to define this substitution. The positions in the string correspond to the alphabet order. The character at each position of the string is the value to be substituted. Note that all other characters (upper case characters, punctuation, whitespace, etc) are unchanged. Also note that the same program can be used for both encoding and decoding a message. The only thing that changes is the conversion string.
Write a program encode.c that encodes the original text file into encrypted text.
Write a program decode.c that decodes the encrypted file into its original form.
You should allow user to choose the source and destination file names, and also to provide the name of text file that contains the encoding key string of length 26.
Details:
To encode or decode a file you should
Define a 26 character conversion string (as described above) to encode the message. Place this string in file encodekey.txt
Write a function that converts the conversion string from encodekey.txt into its complement that allows a text file to be decoded.. This function should be a part of the decode.c program.
Create an input message file cryptoin.txt containing several lines of text with upper/lower case letters, numbers, punctuation, spaces etc all intermixed. The message should be readable.
Write program encode.c that uses the string from encodekey.txt to convert the source file (e.g. cryptoin.txt) to encrypted output file (e.g. cryptoout.txt). You should do the similar with decode.c program.
Example:
convert = cdefghirslmnopqjktuvwxyzab
cryptoin.txt = Now is the time for all 99 men
cryptoout.txt = Nqy su vrg vsog hqt cnn 99 ogp
cryptoback.txt = Now is the time for all 99 men
Explanation / Answer
ublic-key cryptography and related standards and techniques underlie the security features of many products such as signed and encrypted email, single sign-on, and Secure Sockets Layer (SSL) communications. This document introduces the basic concepts of public-key cryptography. For an overview of SSL, see "Introduction to SSL." For an overview of encryption and decryption, see "Encryption and Decryption." Information on digital signatures is available from "Digital Signatures."
lic-key cryptography is a set of well-established techniques and standards for protecting communications from eavesdropping, tampering, and impersonation attacks.
uthentication is the process of confirming an identity. In the context of network interactions, authentication involves the confident identification of one party by another party. Authentication over networks can take many forms. Certificates are one way of supporting authentication.
Network interactions typically take place between a client, such as browser software running on a personal computer, and a server, such as the software and hardware used to host a Web site. Client authentication refers to the confident identification of a client by a server (that is, identification of the person assumed to be using the client software). Server authentication refers to the confident identification of a server by a client (that is, identification of the organization assumed to be responsible for the server at a particular network address).
Client and server authentication are not the only forms of authentication that certificates support. For example, the digital signature on an email message, combined with the certificate that identifies the sender, provide strong evidence that the person identified by that certificate did indeed send that message. Similarly, a digital signature on an HTML form, combined with a certificate that identifies the signer, can provide evidence, after the fact, that the person identified by that certificate did agree to the contents of the form. In addition to authentication, the digital signature in both cases ensures a degree of nonrepudiation-that is, a digital signature makes it difficult for the signer to claim later not to have sent the email or the form.
Some email programs support digitally signed and encrypted email using a widely accepted protocol known as Secure Multipurpose Internet Mail Extension (S/MIME). Using S/MIME to sign or encrypt email messages requires the sender of the message to have an S/MIME certificate.
An email message that includes a digital signature provides some assurance that it was in fact sent by the person whose name appears in the message header, thus providing authentication of the sender. If the digital signature cannot be validated by the email software on the receiving end, the user will be alerted.
The digital signature is unique to the message it accompanies. If the message received differs in any way from the message that was sent-even by the addition or deletion of a comma-the digital signature cannot be validated. Therefore, signed email also provides some assurance that the email has not been tampered with. As discussed at the beginning of this document, this kind of assurance is known as nonrepudiation. In other words, signed email makes it very difficult for the sender to deny having sent the message. This is important for many forms of business communication. (For information about the way digital signatures work, see "Digital Signatures".)
S/MIME also makes it possible to encrypt email messages. This is also important for some business users. However, using encryption for email requires careful planning. If the recipient of encrypted email messages loses his or her private key and does not have access to a backup copy of the key, for example, the encrypted messages can never be decrypted.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.