Software Development

10 Posts

Discover Available Hashing Algorithms in Python with hashlib

Discover Available Hashing Algorithms in Python with hashlib

This blog post explores how to check the available hashing algorithms in Python using the hashlib library. It explains how to view both the platform-specific algorithms and the guaranteed ones that are available across all Python environments, helping you choose the right one for your cryptographic needs.

Dharambir

Dharambir

12 January 2025

Software Development
How to Hash Files in Python Using hashlib: A Step-by-Step Guide

How to Hash Files in Python Using hashlib: A Step-by-Step Guide

In this blog post, we explore how to hash files in Python using the hashlib library. We cover basic file hashing for smaller files as well as more efficient methods using buffered reading for larger files, ensuring data integrity and verifying file contents.

Dharambir

Dharambir

12 January 2025

Software Development
Asymmetric RSA Encryption in Python with PyCrypto: A Step-by-Step Guide

Asymmetric RSA Encryption in Python with PyCrypto: A Step-by-Step Guide

This blog post introduces asymmetric RSA encryption in Python using the PyCrypto library. It explains how to encrypt messages with a recipient’s public key and decrypt them using the corresponding private key. The post also highlights the use of the PKCS#1 OAEP encryption scheme for secure communication.

Dharambir

Dharambir

12 January 2025

Software Development
Symmetric Encryption in Python with PyCrypto: AES Encryption Example

Symmetric Encryption in Python with PyCrypto: AES Encryption Example

This blog post explores symmetric encryption in Python using the PyCrypto library. It demonstrates how to securely encrypt and decrypt messages with the AES algorithm, utilizing a passphrase, random salt, and the PBKDF2 key derivation function to generate the encryption key and initialization vector.

Dharambir

Dharambir

12 January 2025

Software Development
How to Establish Secure Shell Connections in Python with Paramiko

How to Establish Secure Shell Connections in Python with Paramiko

This blog post demonstrates how to securely connect to remote hosts in Python using the Paramiko library. It covers essential parameters like hostname, username, port, and password, as well as how to execute commands via SSH and handle the connection’s status.

Dharambir

Dharambir

12 January 2025

Software Development
Why Python Dictionaries Are Unordered (and How to Keep Insertion Order)

Why Python Dictionaries Are Unordered (and How to Keep Insertion Order)

In Python, dictionaries are unordered by default, unlike C++'s std::map. This post explains how Python dictionaries work, introduces OrderedDict from the collections module to preserve insertion order, and highlights changes in Python 3.6 that ensure insertion order is maintained in dictionaries.

Dharambir

Dharambir

12 January 2025

Software Development
Understanding Variable Leaking in List Comprehensions and For Loops in Python

Understanding Variable Leaking in List Comprehensions and For Loops in Python

This blog post explains the concept of variable leaking in Python, particularly in list comprehensions and for loops. In Python 2.x, the loop control variable "leaks" into the surrounding scope, which can lead to unexpected behavior. We’ll compare this with how Python 3.x handles variable scoping and provide tips to avoid common pitfalls.

Dharambir

Dharambir

12 January 2025

Software Development
Counting Occurrences in Python Using Comprehension: A Simple Guide

Counting Occurrences in Python Using Comprehension: A Simple Guide

In this guide, we explore how to count occurrences in an iterable that meet specific conditions using Python's comprehension syntax. Learn how to apply conditions and use generator expressions for efficient counting.

Dharambir

Dharambir

10 January 2025

Software Development
Accessing Keys and Values in Python Dictionaries: Methods and Best Practices

Accessing Keys and Values in Python Dictionaries: Methods and Best Practices

Learn how to access keys, values, and key-value pairs in Python dictionaries using methods like keys(), values(), and items(). This guide also covers sorting and handling order in dictionaries.

Dharambir

Dharambir

10 January 2025

Software Development
How to Get Unique Elements from a List in Python (Easy Solutions)

How to Get Unique Elements from a List in Python (Easy Solutions)

Learn how to easily remove duplicates from a list in Python using sets. This guide covers how to convert a list to a set to get unique elements and how to return the result to a list format. Perfect for cleaning up data such as restaurant names, file contents, or any other list of items.

Dharambir

Dharambir

1 January 2025

Software Development