• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Vigenere encryption.

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey folks, I've been having a project with Caesar cipher and Vinegere cipher. I already figured out Caesar one but I'm struggling with Vineger cipher. My encryption code is divided into two parts: encrypt() and encrypt1(). encrypt() method extracts every character and passes it to encrypt1() where all of the encryption takes place basically. I did here the code but it's not giving me any good results. For example, if where is a key password and is the String which should be encrypted as . But my code give something like this . COnsider that the alphabet covers almost everything = Could please smb help me with that? Thanks in advance!


 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think your problem is how you are defining keyIndex. It looks like you're actually assigning a character to it. Which "works", because char is an integer type, but it means that it doesn't have the meaning you interpret it as (the number of places to shift the input by).

So, for example, if your password character was 'B' that means you should shift by 2, right? But keyIndex = 'B' = 98.



 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question too difficult for “beginning”: moving discussion.

If you post in several websites, kindly inform everybody reading it.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic