Can Anyone See This Password? Probably Yes – Unless You Encrypt It

Marko Crnjanski

Every time a password is typed or a message is sent, the internet asks: ‘Can anyone else see this?’ - and without proper encryption, the answer is usually yes.

The internet runs on trust, and encryption is what makes that trust possible. Every time a password is typed, a message is sent, or a payment is processed, there’s a silent question in the background: Can anyone else see this?

Without proper cryptography, the answer is often yes.

It doesn’t take much for attackers – an exposed API, a weak hash, or sloppy design can open the door to stolen data, cracked passwords, or injected queries. The risks are real, and the cost of neglect is steep.

That’s why cryptography isn’t a bonus feature. In this article, we’ll dive into the different kinds of encryption you’ll encounter, and walk through how to weave these techniques into your Node.js applications in practical, secure ways – together with Yonatan Mevorach, Developer Advocate at Wix.

The different kinds of encryption and what they do

Think of cryptography as secret-keeping with math – the art of turning plain information into puzzles only the right key can solve. It’s built on a few core principles that Yonatan emphasizes:

  • Confidentiality: Ensuring that information is only accessible to authorized parties.
  • Integrity: Guaranteeing that data remains unaltered during transmission or storage.
  • Authentication: Verifying the identity of users or systems.
  • Non-repudiation: Preventing entities from denying actions they have taken.

These principles shape how secure systems are built and come to life through encryption and cryptographic algorithms. At its core, encryption takes readable data and scrambles it into ciphertext, keeping it safe from prying eyes. In his lecture at the Heapcon conference, Yonatan outlines the main approaches commonly used in modern development:

  1. Symmetric Encryption: Uses a single key for both encryption and decryption. Examples include AES (Advanced Encryption Standard) and DES (Data Encryption Standard)
  2. Asymmetric Encryption: Uses a pair of keys (public and private) for encryption and decryption. Standard algorithms include RSA (Rivest-Shamir-Adleman) and ECC (Elliptic Curve Cryptography)
  3. Hashing: Converts data into a fixed-length hash value, which is irreversible. Examples: SHA-256 (Secure Hash Algorithm), Bcrypt, and Argon2 for password hashing.
  4. Hybrid Encryption: Combines symmetric and asymmetric encryption to balance performance and security. A common implementation is TLS (Transport Layer Security).
  5. Key Derivation Functions (KDFs): Used to derive strong cryptographic keys from passwords or other input values. Examples include PBKDF2 (Password-Based Key Derivation Function 2), Argon2 (Winner of the Password Hashing Competition), and Scrypt (Designed to resist hardware-based attacks).

KDFs are crucial for securely storing passwords and generating encryption keys that are resistant to brute-force attacks.

Securing your apps with Node.js, crypto modules, and modern encryption

As Mevorach explains, developers integrate encryption and cryptographic techniques into applications across various domains:

  • Secure Communications: Protocols like SSL/TLS secure web traffic and APIs.
  • Data Protection: Encrypted databases and file systems (e.g., AES-encrypted storage in cloud environments).
  • Authentication & Access Control: Multi-factor authentication (MFA), digital signatures, and cryptographic tokens.
  • Blockchain & Cryptocurrencies: Cryptographic hashing secures transactions and smart contracts.

Role of the Crypto Module in Node.js

In Node.js, the crypto module provides a set of cryptographic functionalities, including hashing, encryption, and key generation, ensuring to read the official documentation for detailed API usage.

It is widely used in web applications, authentication systems, and secure communication protocols.

Developers can leverage the crypto module to implement secure password storage, encrypt sensitive data, and integrate robust security mechanisms into Node.js applications.

Diffie-Hellman Key Exchange:

This solution solves the key distribution problem by allowing two parties to establish a shared secret over a public channel.

The process? User 1 and User 2 exchange public keys derived from private keys. Each uses the other’s public and private keys to compute the shared secret. Implementation in Node.js uses “crypto. create Diffie-Hellman.”

Developers can protect user data!

“Security best practices are simple in principle but critical in execution. Use proven algorithms like AES-256 and RSA, derive keys securely, and avoid weak or guessable passwords. Always rely on cryptographically secure random generators.”

That said, cryptography comes with its own challenges: key management, performance overhead, and evolving threats. Still, if you follow these best practices, you’re giving your software and your users real protection:

  • Use well-established cryptographic libraries (e.g., OpenSSL, Bouncy Castle).
  • Regularly update algorithms to mitigate vulnerabilities.
  • Implement proper key management (e.g., Hardware Security Modules, cloud-based KMS solutions).
  • Apply encryption at rest, in transit, and during processing where necessary.

So, as cyber threats become more sophisticated, encryption remain tools for secure software development. By integrating strong encryption practices and following industry standards, developers can build trustworthy systems that protect user data and maintain system integrity.

> subscribe shift-mag --latest

Sarcastic headline, but funny enough for engineers to sign up

Get curated content twice a month

* indicates required

Written by people, not robots - at least not yet. May or may not contain traces of sarcasm, but never spam. We value your privacy and if you subscribe, we will use your e-mail address just to send you our marketing newsletter. Check all the details in ShiftMag’s Privacy Notice