# Procedure that does encryption

I am looking for an algorithm/procedure that encrypts a text where the alphanumeric data is encrypted into password-protected alphanumeric data.

I have seen other algorithms where a text like "Hello, How are you?" will be encrypted into something like this: JHo+8D337H/hLwg9n2n2n8+du783bsH9hdsSEWj93==

This is not what I am after.

I am looking for something that does this: "Hello, How are you?" will be encrypted into "Kjehh, Jey uwh wmd?"

Any idea how to do that?

• Do you want it secure (in the sense of preserving secrecy) within preserving capitalization and everything that is not a letter (including space, punctuation, perhaps digits)? That would be easy with FPE. You'd also need to chose between preserving length, and being such that the same plaintext always produce the same ciphertext, which can be a weakness. – fgrieu May 29 '17 at 5:48
• You realise that by preserving punctuation /capitalisation /white space you're exposing vast amounts of information? Proper nouns (ie. names) are capitalised, and the question mark kinda suggests a question was posed. Frequency /syntactical analysis will kill your system. Do you have a very very good reason to maintain format or is this your only knowledge of encryption (which is fine)? – Paul Uszak May 29 '17 at 14:50
• The philosophers amongst us might differ, but I think that your example is not encryption per se, but rather base64 encoding. – Paul Uszak May 29 '17 at 14:52

I would suggest using a classical cipher like Vigenère, for example:

Plaintext:  Hello, How are you?
Key:        topsecret

• @squeamish ossifrage: for Vigenère to be fully secure, one needs (in addition to what's stated in the above comment) that each character of the key is chosen randomly and independently, which does not look like the case for topsecretin the answer. – fgrieu May 29 '17 at 7:04
• @fgrieu topsecret is just an example. it's oviously not intended to be secure, just for understanding. – Aemyl May 29 '17 at 8:20