Bitcoin Forum
April 30, 2024, 08:21:59 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to encrypt so outcome will look a certain way?  (Read 828 times)
Alanay (OP)
Full Member
***
Offline Offline

Activity: 161
Merit: 100



View Profile
July 17, 2016, 02:49:37 PM
 #1

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.

1714465319
Hero Member
*
Offline Offline

Posts: 1714465319

View Profile Personal Message (Offline)

Ignore
1714465319
Reply with quote  #2

1714465319
Report to moderator
In order to get the maximum amount of activity points possible, you just need to post once per day on average. Skipping days is OK as long as you maintain the average.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714465319
Hero Member
*
Offline Offline

Posts: 1714465319

View Profile Personal Message (Offline)

Ignore
1714465319
Reply with quote  #2

1714465319
Report to moderator
1714465319
Hero Member
*
Offline Offline

Posts: 1714465319

View Profile Personal Message (Offline)

Ignore
1714465319
Reply with quote  #2

1714465319
Report to moderator
RHavar
Legendary
*
Offline Offline

Activity: 2557
Merit: 1886



View Profile
July 17, 2016, 03:07:06 PM
 #2

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

Check out gamblingsitefinder.com for a decent list/rankings of crypto casinos. Note: I have no affiliation or interest in it, and don't even agree with all the rankings ... but it's the only uncorrupted review site I'm aware of.
Alanay (OP)
Full Member
***
Offline Offline

Activity: 161
Merit: 100



View Profile
July 17, 2016, 03:19:16 PM
 #3

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.

cloverme
Legendary
*
Offline Offline

Activity: 1512
Merit: 1054


SpacePirate.io


View Profile WWW
July 19, 2016, 07:27:35 PM
 #4

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.
dserrano5
Legendary
*
Offline Offline

Activity: 1974
Merit: 1029



View Profile
July 19, 2016, 09:09:05 PM
 #5

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.
cloverme
Legendary
*
Offline Offline

Activity: 1512
Merit: 1054


SpacePirate.io


View Profile WWW
July 21, 2016, 12:34:15 AM
 #6


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
Shiroslullaby
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250



View Profile
July 25, 2016, 06:56:39 PM
 #7

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.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!