Solved

Vigenere Cipher - variation  - Part II

Posted on 2010-09-07
6
910 Views
Last Modified: 2012-05-10
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_26433255.html#a33622117




If you can show me how your function works wiith examples for each case......starting with

Standard Vigenere  (A...Z)

 lowercase alphabet    'a' - 'z',    
 numeric                        0..9
 special characters      ~`!@#$%^&*()_-+=|\}]{[:;"'?/>.<,
 Control characters


I call your function for the Standard Vigenere  (A...Z) using:

Encrypt
Memo1.Lines.Text:= VigenereExEncrypt(Trim(Memo1.Lines.Text), edtKey.Text);

Decrypt
Memo1.Lines.Text:= VigenereExEncrypt(Trim(Memo1.Lines.Text), edtKey.Text, True);

It looks like it may be encrypting it, but its not using just A..Z, it is showing other characters (special).  And the decrypt does not work.

thanks
0
Comment
Question by:Looking_4_Answers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 46

Expert Comment

by:aikimark
ID: 33622353
What version of Delphi are you using?

You didn't answer that question in the previous thread.  Maybe you'll answer it in this thread.
0
 
LVL 16

Expert Comment

by:CodedK
ID: 33625448
Hi Looking_4_Answers,

As i said on the previous post there is a fault in this logic.


1) You need to know what method was used for encryption in order to decrypt it.
2) The whole Vigenere function should change to something completely different... It should NOT output any letters... Look at the example :

Lets say that you have to encrypt the word A717.
And you use some key that normally will encrypt A717 to 94FJ.

Now A717 word will be encrypted with the "leave A-Z untouched" mode,
OUTPUT :
A717 will be A4FJ.


If we know that the decryption we should use IS the "leave A-Z untouched",
then we should not mess with the first letter (since it wasn't encrypted) but we cannotnot decrypt also the 3rd and the 4th letter that were encrypted! (since  "leave A-Z untouched" mode is on)

So final output :

A7FJ   <-  the only character that was successfully decrypted was the second one!



Solution:

When "Leave A-Z untouched mode" is used we should also block the encrypted output of normal letters.
example :

if '%' -> C based on some key then we should output "-C" ... Some letter "signed" with a special character so we can tell the decryption function if you see this then decrypt it.
This would be at least idiotic.
Or a shift in the table should happen dynamically.
In another words dynamically changing the key word.
This will be equivalent with chaos.

Mixing encrypted text with plain-text don't play well with a decryption function !


Correct me if I am wrong.
Hope this helps.
0
 
LVL 46

Expert Comment

by:aikimark
ID: 33626424
@CodedK

I've been interpreting the requirement as always encrypt [A..Z] and, optionally, encrypt the other character sets.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Accepted Solution

by:
CodedK earned 500 total points
ID: 33629144
The problem still stands only reversed.

Plaintext : @Code  
Encrypted with a key :  @$#G4  [mode : encrypt only A-Z, character '@'  was not encrypted]

Decryption is impossible since  "$" and "#" are also special characters. The function cannot decide which character is encrypted and which is plain text.
0
 

Author Comment

by:Looking_4_Answers
ID: 33666344
ok, i dont undertand why it matters, but its both Delphi 7 & Delphi 2010
0
 

Author Comment

by:Looking_4_Answers
ID: 33666356
I am reviewing and testing and will report back soon, thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses
Course of the Month4 days, 1 hour left to enroll

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question