Python, Cryptography and Hazmat

--

Why Python is not taught in schools is beyond me? For me, it is the pocket calculator of the future and opens up a whole lot of scientific and engineering principles. So while the syntax of the language may be far from perfect and pure, it is the opportunities to integrate libraries such as Numpy, Pandas, and TensorFlow that opens up a new world of opportunity. And it runs on virtually every device you can imagine, and there’s more code around for it than with most of the programming languages.

For cybersecurity, we have great libraries such as cryptography. With this we can hash data can check the output against production systems. So, let’s take a quick look at this library. Overall it contains both “secure” primitives and a “hazmat” layer. The “hazmat” layer should always be treated with care, as it could contain security vulnerabilities. In this case, we will implement a number of hashing primitives with the “hazmat” layer.

Hazmat Hashing

In our first simple example, we will hash our data, and where we take any amount of data and produce a digital fingerprint for it. We normally either represent our data in terms of ASCII characters, hexadecimal values or Base-64 characters. As our hashes are just a whole string of binary values, we normally output hexadecimal or Base-64 values. These can be created using the binascii

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.