Has anyone tried encoding messages using the digits of π?

0
6
Asked By CleverCat89 On

I recently developed a cipher that encodes messages by utilizing the digits of π (pi) as a unique method! I'd love to hear your thoughts on it or any ideas for improvements. Here's how it works:
- Each character of the text is turned into its ASCII value.
- The ASCII number is found in the digits of π (excluding the decimal point).
- We note where the number first appears and how long that sequence is.
- Each character is then encoded using the format `index-length`, which are separated by hyphens.

For example, the ASCII value for the letter 'A' is 65. If this appears for the first time in the digits of π at index 7 (so, the string of digits will look like 141592653...), it will be encoded as `7-2`.

Here's an encrypted message using my cipher, with the encoding method applied:
```
11-2-153-3-94-3-16867-4-...
```

And I've also included some Python code to decode this message, showing how you can translate back from the encoded format to the original text. Feel free to modify it for your own use!

1 Answer

Answered By HappyCoder42 On

What a neat concept! I love this idea! Two questions:
- Is it true that π contains all the sequences you need to represent ASCII values from 0 to 255? I’m not exactly a math wiz, just curious! 🤔
- Any thoughts on using Unicode next? 😅

MathNerd101 -

Yes, technically π is believed to contain every possible finite sequence, but the reality is that you need to look for a long time to find certain patterns!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.