Stack Exchange
Decryption in Java using vigenere cipher
msgDe = "";
        msg = msg.toUpperCase();
        for (int i = 0, j = 0; i < msg.length(); i++) {
            char c = msg.charAt(i);
            if (c == '*') {
             msgDe = msgDe + " ";
             }
            if (c < 'A' || c > 'Z') {
                continue;
            }
            msgDe += (char) ((c + key.charAt(j) + 2 * 'A') % 26 + 'A');
            j = ++j % key.length();
        }
        objDBase.setMsgDe(msgDe);
        txaODe.setText(objDBase.toStringDe());

msgDe is the new decrypted message
msg is the inputted encrypted message
objDBase is the obj name
The following is in my obj class:
public class BEDC {

private String msgDe;
public BEDC(String msgDe)
{
   this.msgDe = msgDe;
}
public String toStringDe()
{
    return "New message: \n" + msgDe; 
}
 public void setMsgDe(String msgDe)
 {
     this.msgDe = msgDe;
 }

The following is declared globally:
String msgDe = "";
BEDC objDBase = new BEDC(msgDe);

Help is appreciated :>

what is your question?

You should first bring the input and key character towards 0..25 before doing the calculations, then bring back the result towards A..Z (e.g. by subtraction or addition with the value of A). Things like 2 * 'A' make no sense to me at all.
