Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Vigenere Cipher - variation  - Part II

Posted on 2010-09-07
6
Medium Priority
?
912 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 16

Accepted Solution

by:
CodedK earned 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

715 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