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
2 answers

Colon character getting encoded to x003A in xml element serialization process

I have defined type as Example as shown below, after instantiating a object and serializing using XmlSerializer, i am getting x003A instead of colon : Here's my code: public class Example { [XmlElement("Node1")] …
8
votes
1 answer

Encrypt RSA/ECB/OAEPWithSHA-256AndMGF1Padding Swift

I am going to say in advance i don't know too much about cryptography (Basics only). I am trying to Implement a Credential OpenHome Service and I want to encrypt a password to send it to the device. The device provides a function written in C that…
Reimond Hill
  • 4,278
  • 40
  • 52
8
votes
2 answers

BouncyCastle Open PGP - unknown object in stream 47

I am trying to decrypt PGP encrypted string using the BouncyCastle PGP SDK. I have tried several approaches and in each case I get a following error at the beginning of the process (exact place shown below): unknown object in stream 47 I have so…
Bartosz
  • 4,406
  • 7
  • 41
  • 80
8
votes
5 answers

Always Encryption: Failed to decrypt a column encryption key using key store provider: 'MSSQL_CERTIFICATE_STORE'

I am performing Always encryption in my web application, Which insert data by a WCF service which is hosted by a window service. I am getting following error while insertion of data into encrypted column. Failed to decrypt a column encryption key…
user2640965
  • 83
  • 1
  • 1
  • 6
8
votes
3 answers

AES, Serpent or Twofish in C example?

I found a lot of implementations of AES, Twofish and Serpent in C. But I don't really understand the examples. I only understand that some where provided with examples to invert a matrix. Can someone point me to an example or .c file for to…
killercode
  • 1,666
  • 5
  • 29
  • 42
8
votes
2 answers

RSA Encrypt/Decrypt in TypeScript

I'm using Angular 4 to make the front end of my application. I have implemented OAuth2 on my backend (developed with Spring in Java), so people using my application must be authenticated. The thing is that we can see clearly the passwords from the…
Romeortec
  • 211
  • 1
  • 2
  • 11
8
votes
3 answers

How to do large file parallel encryption using GnuPG and GNU parallel?

I'm trying to write a parallel compress / encrypt backup script for archiving using GNU parallel, xz and GnuPG. The core part's of script is: tar --create --format=posix --preserve-permissions --same-owner --directory $BASE/$name --to-stdout . \ …
Yongbin Yu
  • 108
  • 1
  • 8
8
votes
2 answers

How to encrypt server.ssl.key-store-password value and use it in SpringBoot

I would like to know is there anyway we can encrypt the server.ssl.key-store-password value and store it in application.properties file instead of storing it in plain text. i couldn't find any documentation on this. Any help on this is highly…
Nagaraju Chitimilla
  • 530
  • 3
  • 7
  • 23
8
votes
1 answer

Storing locally encrypted incremental ZFS snapshots in Amazon Glacier

To have truly off-site and durable backups of my ZFS pool, I would like to store zfs snapshots in Amazon Glacier. The data would need to be encrypted locally, independently from Amazon, to ensure privacy. How could I accomplish this?
TinkerTank
  • 5,685
  • 2
  • 32
  • 41
8
votes
3 answers

Decryption Error: Pad block corrupted

I have the following code. byte[] input = etInput.getText().toString().getBytes(); byte[] keyBytes = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,…
kangalert
  • 341
  • 2
  • 5
  • 7
8
votes
2 answers

Using IDataProtectionProvider in test project?

When using IDataProtectionProvider in a Web API, the IoC container is configured with AddDataProtection (services.AddDataProtection();) and enables the use of DI to retrieve a IDataProtectionProviderin a service as such: private readonly…
Marcus
  • 8,230
  • 11
  • 61
  • 88
8
votes
1 answer

Using node-jose, how do I decrypt the data I just encrypted?

I am trying to implement simple JOSE encrypt and decrypt functions using node-jose. My code is as follows (written using Node 8.2.1) const { JWE } = require('node-jose'); const jose = (publicKey, privateKey) => { async function encrypt(raw) { …
Dave Sag
  • 13,266
  • 14
  • 86
  • 134
8
votes
1 answer

Bad XMLHttpRequest when uploading to S3

I'm using Evaporate.js to upload files to S3. I've had everything working, until I decided to enable server side encryption. According to the S3 docs, you can enable it by passing a header. So I updated my add code to look like: var promise =…
Muhambi
  • 3,472
  • 6
  • 31
  • 55
8
votes
3 answers

Changing master password that is used for encryption

I want to store some data encrypted, for example like a password manager where your master password unlocks all the underlying app/site passwords. Looking around I found some examples like this, but they seem to use the password as a part of the…
PixelSnader
  • 552
  • 1
  • 4
  • 9
8
votes
7 answers

Two-key encryption/decryption?

I'm looking to store some fairly sensitive data using PHP and MySQL and will be using some form of reversible encryption to do so since I need to get the data back out in plain text for it to be of any use. I'll be deriving the encryption key from…
Matt
  • 9,068
  • 12
  • 64
  • 84