Questions tagged [encryption]

Encryption is the process of transforming information (called plaintext) into an unreadable form (called ciphertext) using an encryption algorithm using a secondary parameter (called an encryption key). Only those who possess the decryption key can easily reverse the process and recover the original plaintext. Conceptual questions about encryption may get better answers on crypto.stackexchange.com.

In cryptography, encryption is the process of transforming information (called plaintext) into an unreadable form (called ciphertext) using an encryption algorithm combined with a parameter called an encryption key. Reversing the process, that is transforming the ciphertext into plaintext, is called decryption. Only those who possess the decryption key can reverse the process and recover the original plaintext.

There are 2 types of encryption methods generally:

  • symmetric
  • asymmetric

In symmetric encryption the encryption and decryption keys are the one and the same; this single key is sometimes called the shared secret key. Rijndael(AES), TwoFish, and Cha-Cha are examples of symmetric encryption algorithms.

In asymmetric encryption, also known as public key encryption, the encryption and decryption keys are different. The encryption key is called the public key and the decryption key is called the private key. RSA, Diffie-Hellman (DH), El-Gamal (ElG), and elliptic curve variants of DH and ElG are examples of public key encryption algorithms.

The term "encryption" should be reserved for transformations intended to be reversed or "decrypted". In particular, cryptographic transformations intended to be one way, such as cryptographic hash algorithms (e.g. SHA1, SHA2, SHA3) and password hashing algorithms (e.g. bcrypt, scrypt) should not be referred to as "encryption".

Encryption has long been used by militaries and governments to facilitate secret communication. Encryption is now commonly used in protecting information within many kinds of civilian systems. It can be used to protect data "at rest", such as files on computers and storage devices (e.g. USB flash drives). In recent years there have been numerous reports of confidential data such as customers' personal records being exposed through loss or theft of laptops or backup drives. Encrypting such files at rest helps protect them should physical security measures fail. Digital rights management systems which prevent unauthorized use or reproduction of copyrighted material and protect software against reverse engineering (see also copy protection) are another somewhat different example of using encryption on data at rest.

Encryption is also used to protect data in transit, for example data being transferred via networks (e.g. the Internet, e-commerce), mobile telephones, wireless microphones, wireless intercom systems, Bluetooth devices and bank automatic teller machines. There have been numerous reports of data in transit being intercepted in recent years. Encrypting data in transit also helps to secure it as it is often difficult to physically secure all access to networks.

Encryption, by itself, can protect the confidentiality of messages, but other techniques are still needed to protect the integrity and authenticity of a message; for example, verification of a message authentication code (MAC) or a digital signature. Standards and cryptographic software and hardware to perform encryption are widely available, but successfully using encryption to ensure security may be a challenging problem. A single slip-up in system design or execution can allow successful attacks. Sometimes an adversary can obtain unencrypted information without directly undoing the encryption. See, e.g., traffic analysis, TEMPEST, or Trojan horse.

One of the earliest public key encryption applications was called Pretty Good Privacy (PGP). It was written in 1991 by Phil Zimmermann and was purchased by Network Associates (now PGP Corporation) in 1997.

Source: Wikipedia.

See also:


Note: conceptual questions about encryption might get more attention and better answers from the Crypto stack exchange.

36876 questions
8
votes
0 answers

How can SQL Server client get information on TLS certificate being used?

If a client connects to SQL Server, and a certificate is used to power TLS encryption, how can i get information about that certificate? Ideally i want all the details, but i'd be happy with Issuer: SSL_Self_Signed_Fallback Issued to:…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
8
votes
6 answers

C# AES Rijndael - detecting invalid passwords

I'm using Rijndael to encrypt some sensitive data in my program. When the user enters an incorrect password, most of the time a CryptographicException is thrown with the message "Padding is invalid and cannot be removed.". However, with very small…
Ozzah
  • 10,631
  • 16
  • 77
  • 116
8
votes
1 answer

Expired SSL Certificate and Encryption

I am relatively new to the world of web development and wanted to know if an expired SSL certificate renders encryption useless or does the site remain encrypted however not tell the user that there is a valid certificate that has not expired?
PeanutsMonkey
  • 6,919
  • 23
  • 73
  • 103
8
votes
0 answers

Keystore getEntry returns NULL on Android 9

cI have encrypted and decrypted a login password which is stored in the Android Keystore. On Android 9, I observed that the app crashes when trying to decrypt the password(I am not able to reproduce it but people having Pixel 3 are one of the…
user2234
  • 1,282
  • 1
  • 21
  • 44
8
votes
3 answers

For emergencies: share part of pass with 4 people, decryptable with 2 persons

Let's say I have a password: AAABBBCCCDDD I could easily give person A the first part (AAA), person B the second part and so on. But is there an option any two of the four people can decrypt/form the password from a part of text I give them?…
Karel
  • 369
  • 1
  • 5
  • 20
8
votes
1 answer

How to Encrypt Data in Javascript with RSA public key?

Server generates RSA public and private keys and store them in the session. Over a server call the client html page recieves the public key. Now I want to encrypt data using it. I have tried using jsencrypt but it doesn't recognize the public key my…
8
votes
5 answers

Purpose built light-weight alternative to SSL/TLS?

Target hardware is a rather low-powered MCU (ARM Cortex-M3 @72MHz, with just about 64KB SRAM and 256KB flash), so walking the thin line here. My board does have ethernet, and I will eventually get lwIP (lightweight TCP/IP FOSS suite) running on it…
mike.dinnone
  • 732
  • 2
  • 8
  • 17
8
votes
3 answers

RSA Encryption function in Swift 4 from Public Key string

My ultimate goal is to create a JWE string, given a public key for iOS. To make things easier for myself, I've broken down my steps so most pressingly, I need to create an encrypted key using RSA encryption from a secret key and public key…
clientside-gem
  • 83
  • 1
  • 1
  • 4
8
votes
5 answers

Cryptanalysis: XOR of two plaintext files

I have a file which contains the result of two XORed plaintext files. How do I attack this file in order to decrypt either of the plaintext files? I have searched quite a bit, but could not find any answers. Thanks! EDIT: Well, I also have the two…
OckhamsRazor
  • 4,824
  • 13
  • 51
  • 88
8
votes
4 answers

How to protect strings without SecureString?

The use case is to protect strings in memory programming in c#. The use of the class SecureString (https://learn.microsoft.com/en-us/dotnet/api/system.security.securestring?view=netframework-4.7.2) is discouraged by Microsoft itself. I was wondering…
Francesca Merighi
  • 317
  • 1
  • 3
  • 10
8
votes
2 answers

What algorithm does Microsoft Office 2010 use for encryption?

Does it use the standard AES 128bit key for encryption? I've searched a lot on Google, but I still haven't found the algorithm is uses for encrypting. I'm encrypting a PowerPoint file.
user478636
  • 3,304
  • 15
  • 49
  • 76
8
votes
2 answers

Exact alternate to mcrypt_encrypt in PHP 7.2

Since mcrypt_encrypt is no longer supported in PHP 7.2, I am trying for exact alternate to this function. After reading many SO answers I have found the following code which uses PHPSECLIB, but it's not producing the exact encrypted text as…
user1918906
  • 85
  • 1
  • 4
8
votes
1 answer

Decode(Base64) and Decrypt(AES/CBC/PKCS5PADDING) with CryptoJS - React

I am working on the web application using react as front-end and spring mvc as back-end. I need to store some user information in local storage of the browser. I do not want to store that info in local storage as a plain text. So I thought to go for…
samkit shah
  • 657
  • 7
  • 18
8
votes
3 answers

How can I force a CipherOutputStream to finish encrypting but leave the underlying stream open?

I have a CipherOutputStream backed by another OutputStream. After I have finished writing all the data I need encrypted to the CipherOutputStream, I need to append some unencrypted data. The documentation for CipherOutputStream says that calling…
user79758
8
votes
2 answers

How to send gpg encrypted email (with attachment) using python

I have a script that I want to email newly generated files in a given folder. I have been able to generate and send emails (without encryption) by using smtplib, email and uu. I also managed to successfully send a gpg encrypted without…
klausmcm
  • 111
  • 3
  • 7