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
1 answer

How to build the Qt-SQL-driver-plugin 'QSQLCIPHER' for SQLite-DB with SQLCipher-extension using the Windows/MinGW-platform?

This is not typically a question where to find a step-by-step guide, but rather the guide itself. My intention with this post is to give others a hint, who have the same problems in compiling the driver-plugin as I just had recently. How to build…
Woodpecker
  • 117
  • 1
  • 5
8
votes
2 answers

Encrypt password fields in mongodb

I have following code, it insert the userName and password into database but the password is stored in plain text format. I mean when I'll look into the db I can see the inserted password. I want to store password in encrypted format MongoClient…
PVH
  • 83
  • 1
  • 1
  • 5
8
votes
1 answer

Can I encrypt web.config with a custom protection provider who's assembly is not in the GAC?

I have written a custom protected configuration provider for my web.config. When I try to encrypt my web.config with it I get the following error from aspnet_iisreg aspnet_regiis.exe -pef appSettings . -prov CustomProvider (This is running in my…
James
  • 2,458
  • 3
  • 26
  • 50
8
votes
1 answer

Java AES encryption/decryption procedure and usage of Initialization Vector

I want to learn the basics of AES encryption so I started to make a very simple Java program. The program loads a text file in to a String and asks for a key from the user. The program then uses AES to encrypt the text creating a new text file with…
Leevi Lehtonen
  • 118
  • 1
  • 1
  • 7
8
votes
1 answer

How do I play a DES encrypted File using ExoPlayer

I am using ExoPlayer to play Media files(mp4s .h264 encoded) from the SD card of a device. Some of the files are DES encrypted. I can decrypt the files and get back an inputStream, but then I am unsure of how to play this inputStream using…
Adam W
  • 972
  • 9
  • 18
8
votes
5 answers

SSL encryption, SHA-1 and SHA-2

I am trying to implement SHA-2 encryption instead of SHA-1. For this, I know that the number of bits between these two hash algorithms are different, and it confuses me. How can this be achieved and at what parts do I need to make required…
Hellnar
  • 62,315
  • 79
  • 204
  • 279
8
votes
1 answer

CryptographicException: Bad PKCS7 padding

I am seeing a small percentage of production users randomly report this exception related to encrypting/decrypting strings with Xamarin.Android but unfortunately I cannot reproduce it. What could cause this and/or how could I reproduce the exception…
Le-roy Staines
  • 2,037
  • 2
  • 22
  • 40
8
votes
6 answers

UDP security and identifying incoming data

I have been creating an application using UDP for transmitting and receiving information. The problem I am running into is security. Right now I am using the IP/socketid in determining what data belongs to whom. However, I have been reading about…
Charles
  • 81
  • 1
  • 2
8
votes
2 answers

Does ProtectedData work on multiple computers?

I am looking into storing some sensitive data in an application I am working on. I have been looking at the ProtectedData class provided by Microsoft, and it looks pretty straightforward. However, I have a couple of questions regarding how it…
dub stylee
  • 3,252
  • 5
  • 38
  • 59
8
votes
2 answers

Securing data on SD card Raspberry Pi

I need to store sensitive data on Raspberry so that software running on Raspberry can use it, but nobody else cannot. I can set hard password, disable tty's and so on, but it's easy to remove SD card and examine in on a PC. My first try is eCryptFS.…
Oleg Antonyan
  • 2,943
  • 3
  • 28
  • 44
8
votes
0 answers

iOS App Security Best Practices (API Keys, Constants, WS URLs, Credentials)

What are the best practices to add the extra security in iOS App so Attackers/Hackers can not easily find the Secure Private Keys, Constants strings inside the code. P.S: I found some other related questions which were answered partially or missing…
W.S
  • 931
  • 1
  • 10
  • 36
8
votes
3 answers

How to correctly and consistely get bytes from a string for AES encryption?

I am currently working on AES implementation in C#. The encryption method has two parameters: a string and a password. I am taking the supplied string and converting it to an array of bytes, so I can use it later for writing data to a stream with…
Geronimo Rodriguez
  • 189
  • 1
  • 4
  • 9
8
votes
3 answers

How to store key using Android Key Store Provider

I am trying to use the Android Key Store Provider that became available in Android 4.3 to securely save a Private Key and to then use this private key to encrypt and decode data. I think I have implemented the correct approach and code for this so…
Donal Rafferty
  • 19,707
  • 39
  • 114
  • 191
8
votes
2 answers

Unique Salt per User using Flask-Security

After reading here a bit about salting passwords, it seems that it's best to use a unique salt for each user. I'm working on implementing Flask-Security atm, and from the documentation it appears you can only set a global salt: ie…
Chockomonkey
  • 3,895
  • 7
  • 38
  • 55
8
votes
2 answers

RSA encrypt then decrypt fails with "oaep decoding error"

I am trying to debug a simple openssl program but cannot quite get what openssl means with "oaep decoding error". I have reduced my program to this, test, one: #include #include #include #include…
qdii
  • 12,505
  • 10
  • 59
  • 116
1 2 3
99
100