• 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 proplem

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

am trying to do a Vigenere java program put the cipher text in the output apears empty

this is my class




this is my mean



and this is the output

pleas enter your plain text
hadeel
pleas enter your key
aa
the chiper text is:

 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hadeel marghlany wrote:am trying to do a Vigenere java program put the cipher text in the output apears empty


Well, my first suggestion would be to break up that awful
cipher = cipher+ letter.charAt((letter.indexOf (key.charAt(j)+letter.indexOf (message.charAt(j)))) %26);
line into something more readable.

I'm also not quite sure why you're using indexOf(). A Vignere cypher should use direct indexes, not searches.

Winston
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic