# Caesar Cipher Text

**URL:** <https://discourse.processing.org/t/caesar-cipher-text/15477>\
**Category:** Coding Questions\
**Created:** [November 14, 2019, 2:49am UTC](https://discourse.processing.org/t/caesar-cipher-text/15477 "2019-11-14T02:49:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian1998](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@Adrian1998](https://discourse.processing.org/u/Adrian1998)\
**Post date:** [November 14, 2019, 2:49am UTC](https://discourse.processing.org/t/caesar-cipher-text/15477/1 "2019-11-14T02:49:33Z")

</div>

Hello I am currently struggling very hard on this program. I have to make a caesar cipher program and I can not figure out how to make the program cipher once.

```auto

String Alpha = "abcdefghijklmnopqrstuvwxyz";
int i = 0;
void setup() {
  size(800, 375);
  textSize(50);
}

String Cipher = "";
String text = "";
String test = "";
String number = "";
void keyPressed() {
  if (key != CODED) {
    text += key;
    Cipher += i;
    if (key == '\n') {
      text = "";
      Cipher = "";
    }
      if (key >= '0' && key <= '9') {
        number += key;
      }
    }
  }
void draw() {
   for (int Cipher = 0; Cipher < Alpha.length(); Cipher++)
    background(100);
    fill(255, 255, 255);
    text("Encrypter", 280, 50);
    text("shift:" + number, 600, 50);
    text("Plain Text:" + text, 30, 150);
    fill(216, 229, 42);
    text("Caesar:" + Cipher, 30, 250);
  }

```

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [November 14, 2019, 5:32am UTC](https://discourse.processing.org/t/caesar-cipher-text/15477/2 "2019-11-14T05:32:29Z")

</div>

```auto
int i = 0;
String Cipher = "";

// and in keyPressed you do:
    Cipher += i;

```

why?

you know already what you have to code?  
see [https://www.geeksforgeeks.org/caesar-cipher-in-cryptography/](https://www.geeksforgeeks.org/caesar-cipher-in-cryptography/) here
