2

I have a bit of a unique problem with an upcoming project; I need an algorithm that can take non-plaintext data from a variable and decrypt it as fast as possible. However, I use decrypt in the loosest possible sense of the word, because what I am looking for is a simple, optimized algorithm in which the sole objective is fast decryption. The complexity/difficulty of decrypting the said string is unimportant; For these purposes, a string with all of its characters shifted by one bit would be every bit as effective as an AES implementation. I understand I could simply iterate through "encrypted" string and shift all of its characters, but I'm curious as to if there's a faster way to achieve this. I was considering caching, but I'm unsure if this script would be able to write files, so that complicates matters. Also, please note, I would NOT be able to install a plugin/extension (not even PECL), so this must be purely PHP.

1 Answer 1

7

You could use str_rot13() - It's extremely simple but it's native PHP.

Sign up to request clarification or add additional context in comments.

1 Comment

What exactly do you want to achieve? Rot13 is perfect for this, but it is not really "crypted", you can spot Rot13 by just looking at the result. In general, most crypting functions are designed for speed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.