• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Vigenere encryption.

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
  • 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: 68862
275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question too difficult for “beginning”: moving discussion.

If you post in several websites, kindly inform everybody reading it.
 
A berm makes a great wind break. And we all like to break wind once in a while. Like this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic