Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

php[architect]:
Education Station: Shifting and Masking with a Side of Crypto
Feb 23, 2018 @ 17:34:45

The php[architect] site has posted an article published in their February 2018 issue by Edward Barnard as a part of his "Education Station" column. The article covers bit shifting and how it relates to cryptography in PHP.

The basics can be tricky. This month we take a careful walk-through of a few lines of cryptographic code in PHP. This leads us through the difference between ones’ complement and two’s complement representation. We achieve weirdness by combining logical AND with integer addition.

He starts with a bit of a history lesson going back to mainframes and keypunching followed by a look at the logical and bitwise operators. He then takes some of these basics and applies them to the world of cryptography and provides some example code and a constant-time encoding algorithm. This leads to a discussion about ones' compliment, signed zero, two's compliment and "packing".

tagged: shifting masking phparchitect educationstation cryptography

Link: https://www.phparch.com/2018/02/education-station-shifting-and-masking-with-a-side-of-crypto/


Trending Topics: