Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Simply Decrypting
Replies: 3   Last Post: Sep 4, 2013 2:19 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Curious

Posts: 1,969
Registered: 12/6/04
Re: Simply Decrypting
Posted: Sep 4, 2013 2:19 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Ar " <ariq.quazifc@gmail.com> wrote in message <l06916$hud$1@newscl01ah.mathworks.com>...
> Trying to solve to problem, but have no idea where to start from.

If you are stuck,
(1) Forget MATLAB, first try solving it with just pencil and paper.
(2) Then use MATLAB to encode exactly what you did step-by-step.
(3) If you get stuck at a specific step, ask us a SPECIFIC question.

>
> One of the simplest methods to encrypt a message is by using a key that defines
> how many positions the letters in the text is replaced.
> If you encrypt a text with a key 3, all letters in the original text moves down the
> alphabet by 3 positions.
> If you decrypt a text with a key 3, all letters in the decrypted text moves up the
> alphabet by 3 positions (i.e d a ; f c; etc )
>
> e.g
> if you encrypt the text ?trial? with a key of 3, it will become ?wuldo?
> if you decrypt the text ?wuldo? with a key of 3, it becomes ?trial?
>
> (a) Write an M-file to can decrypt the following message ?brx pdqdjhg wr gr
> lw.? using a key of 3.
> (b) Write an M-file that can load the text file ?encrypted_text.txt?
>
> Notes:
> i. Only alpha-characters have been encrypted. Punctuations and white
> spaces have not been altered and as such in your codes, you should not
> decrypt any punctuations or white spaces.
> ii. The alphabet has 26 letters. So your encryption key should always be
> between 1 and 26.
> iii. You might use MATLAB inbuilt function ?find?
> iv. See more hints in the lab4presentation file on moodle


What are those hints? There must be clues in there.
But we don't know them. My hints:

doc char
doc double

How are you going to handle negative numbers?
For example, if 'a' == 1, then what is the result of:
'a' - 3 = ?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.