Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encrypt text using a number

Project Euler

I have recently begun to solve some of the Project Euler riddles. I found the discussion forum in the site a bit frustrating (most of the discussions are closed and poorly-threaded), So I have decided to publish my Python solutions on launchpad for discussion.

The problem is that it seems quite unethical to publish these solutions, as it would let other people gain reputation without doing the programming work, which the site deeply discourages.

My Encryption problem

I want to encrypt my answers so that only those who have already solved the riddles can see my code. The logical key would be the answer to the riddle, which is always numeric.

In order to prevent brute-force attacks on my answers, I want to find an encryption algorithm that takes a significantly long time (few seconds) to run.

Do you know any such algorithm? I would fancy a Python package, which I can attach to the code, over an external program that might have portability issues.

Thanks,

Adam

like image 966
Adam Matan Avatar asked May 27 '10 23:05

Adam Matan


People also ask

How do you encrypt a text?

Type Ctrl + Shift + X on your keyboard to encrypt the selected text.

Can you encrypt a number?

Encryption is a two-step process. In the first step, the program replaces each digit of the number by its position within its array element, as illustrated here. The second step is to translate the resulting digit character to “garbage” characters.

What is encrypt phone number?

End‑to‑end encryption is a technology that keeps the content you share private and secure, from one endpoint (such as your phone) to another (such as the phone of the person you are talking to). The content you share will be unreadable if it is intercepted in transit.


1 Answers

It sounds like people will have to write their own decryption utility, or use something off-the-shelf, or use off-the-shelf components to decrypt your posts.

PBKDF2 is a standardized algorithm for password-based key derivation, defined in PKCS #5. Basically, you can tune "iterations" parameter so that deriving the key from a password (the answer to the Euler problem) would take several seconds. The key can then be used for any common symmetric encryption algorithm, like AES-128.

This has the advantage that most crypto libraries already support PBKDF2. In fact, you might find mail clients that support password-based encryption for S/MIME messages. Then you could just post an S/MIME and people could read it with the mail client. Unfortunately, my mail client (Thunderbird) only supports public-key encryption.

like image 148
erickson Avatar answered Oct 10 '22 03:10

erickson