Author

Topic: How to encrypt so outcome will look a certain way? (Read 851 times)

sr. member
Activity: 434
Merit: 250
Yeah this sounds like some sort of ciphertext.
You would have to create it yourself, since you have a very specific outcome that you want, but it wouldn't be too hard to come up with a basic cipher.

I can think about this more when I get home later, since Im only on a quick break at work.

Hannah_Montana >> 1 place
becomes
Ibo14.bj_13.pou114.b

H > I
a > b
n > o
n > 14.
a > b
h > j

M > 13.
o > p
n > o
t > u
a > 1
n > 14.
a > b

Theres probably a better solution to the numbers greater than the 9th place this is literally something I made in two mintues.
legendary
Activity: 1512
Merit: 1057
SpacePirate.io

That looks as just another layer of "encryption". And, what happens when you run out of letters? Because, you know, the hex alphabet has 10 digit and 6 letters. If you take 3 of each at a time, you're most probably going to run out of letters way before reaching the end of the string.

@OP: a good ciphertext should be indistinguishable from random data. Why try to make it look less random? You're not going to fool anyone with that approach.

Completely agree, was throwing spaghetti at the wall... concepts of ROT13 mixed with offset and length values... Grin
No idea what OP was trying to do in reality, maybe a school exercise?

Wasn't motivated enough to don propeller hat and come up with full solution  Cool
legendary
Activity: 1974
Merit: 1029
Hash: 9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08

Your ciphertext: fdc 896 daf ....

Your keymap of positions: f2, d5, c12 ...

That looks as just another layer of "encryption". And, what happens when you run out of letters? Because, you know, the hex alphabet has 10 digit and 6 letters. If you take 3 of each at a time, you're most probably going to run out of letters way before reaching the end of the string.

@OP: a good ciphertext should be indistinguishable from random data. Why try to make it look less random? You're not going to fool anyone with that approach.
legendary
Activity: 1512
Merit: 1057
SpacePirate.io
I'm looking to find a method of encryption to encrypt a long list of characters and numbers. For example I could encrypt a list of 120 characters, including 0-9 numbers, and a-z characters. Then I want the outcome to always look something like "abc123def456". So an outcome might look like "ioe527kkl981", that is 3 letters followed by 3 numbers followed by 3 letters followed by 3 numbers.

Is this possible, and if so what's the easiest way to do it?

Thank you.

What you're talking about (the outcome) is called ciphertext. You would need to come up with your encryption scheme to allow you to encrypt or obfuscate your information in that way. However, with that kind of specific output, you're imparting a method to decrypt it as well.

If you're really that interested in a specific ciphertext pattern, my suggestion would be to hash the data, then write code that would record the original positions of the unsorted key.

Hash: 9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08

Your ciphertext: fdc 896 daf ....

Your keymap of positions: f2, d5, c12 ...

Lots of other solutions to do what you're looking to do.
full member
Activity: 161
Merit: 100
This question might be better posted on stackoverflow than here, but yes it's possible. So when you encrypt something, most libraries are going to expose is as an array of bytes. So your real question actually distills down to an encoding/decoding one. But to get you started, what you'll want to do is encode the first X of the value in base A and then display them. Then then next Y of the value in base B and then display them. And then repeat. It's definitely going to be a lot trickier than just hex-encoding, so I'd think hard about if you really need it

Thank you, I've moved my question on over to there. I'll spend some time today thinking more about this.
full member
Activity: 161
Merit: 100
I'm looking to find a method of encryption to encrypt a long list of characters and numbers. For example I could encrypt a list of 120 characters, including 0-9 numbers, and a-z characters. Then I want the outcome to always look something like "abc123def456". So an outcome might look like "ioe527kkl981", that is 3 letters followed by 3 numbers followed by 3 letters followed by 3 numbers.

Is this possible, and if so what's the easiest way to do it?

Thank you.
Jump to: