• Post Reply Bookmark Topic Watch Topic
  • New Topic

Vigenere Cipher code help

 
John Trann
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm an awful beginner at java. I'm trying to form a Vigenere cipher code and was wondering if anyone can assist me. My code is expected to encrypt a message and show the decrypted message as well.

My output is


However, my expected output is


Can anyone help me figure out how to make the result not ignore punctuation, numbers, and casing?


 
Norm Radder
Rancher
Posts: 1649
22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing I see is the encryption skips over characters not in the a-z range, but the expected output shows that those characters are just copied thru.
 
Campbell Ritchie
Marshal
Posts: 53171
124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.. and welcome to the Ranch
 
Junilu Lacar
Marshal
Posts: 10409
125
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't want to ignore case then why are you converting to lowercase in lines 17 and 32?
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!