1. ## Quick quester

Hey, how would you assess the dificulty in writing an bitwiseshift decryption program is C++? Moderate? Easy? Difficult? It would have to decrypt at a specified shift place (like three left).

Also, is it possible to write one in any type of scripting language (aka javascript)?

Thanks.
-Wynter

2. Definitely. One you get the algorithm down mathematically, the coding is simple.

Kuphryn

3. ## It's not hard if you know a couple of things...

You need to know about file I/O, and bit-shifting. There is some good information about bit shifting in the Programming FAQ.

Something keep in-mind: Bit-shifting throws-away bits. If you shift-left 3 bits, you loose the 3 leftmost bits. This should NOT be a problem with most 16-bit or 32 bit operating systems, assuming that you are encrypting/decrypting ASCII, which only uses 8-bits. You may need to use typecasting or some other tricks to get your data into a type with enough extra bits. Good programming practice would require you to use sizeof() or <limits> to make sure that you never loose any data.

If you want to do bit-rotation, and put those "lost" leftmost bits into the "new" rightmost bits, you'll have to write the code yourself using the other bitwise operators.

I don't know java script, but I sort-of suspect it's too "high-level" to have any bit manipulation instructions. You could do bit-shifting by multiplying and dividing by two (or multiples of two).

4. Okay, thanks. That's really helpful. I need to write one to decrypt a file from a challenge site and I think it's a bitwise shift, or rotation. IE: 100110 shifted 2 left would be 011010. I appriciate the help though I think that I'll need some specific questions answered when I get down to coding it.