Skip to main content

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.

Filter by
Sorted by
Tagged with
782 votes
9 answers
334k views

Are HTTPS headers encrypted?

When sending data over HTTPS, I know the content is encrypted, however I hear mixed answers about whether the headers are encrypted, or how much of the header is encrypted. How much of HTTPS headers ...
Dan Herbert's user avatar
755 votes
29 answers
835k views

Encrypt and decrypt a string in C#? [closed]

How can I encrypt and decrypt a string in C#?
NotDan's user avatar
  • 32.1k
613 votes
9 answers
539k views

How to choose an AES encryption mode (CBC ECB CTR OCB CFB)? [closed]

Which of them are preferred in which circumstances? I'd like to see the list of evaluation crtieria for the various modes, and maybe a discussion of the applicability of each criterion. For ...
Cheeso's user avatar
  • 191k
543 votes
14 answers
230k views

Fundamental difference between Hashing and Encryption algorithms

I see a lot of confusion between hashes and encryption algorithms and I would like to hear some more expert advice about: When to use hashes vs encryptions What makes a hash or encryption algorithm ...
Kenny Cason's user avatar
  • 12.2k
485 votes
14 answers
295k views

Does my application "contain encryption"?

I'm uploading a binary for the first time. iTunes Connect has asked me: Export laws require that products containing encryption be properly authorized for export. Failure to comply could result ...
Steven Fisher's user avatar
443 votes
7 answers
886k views

Encrypting & Decrypting a String in C# [duplicate]

What is the most modern (best) way of satisfying the following in C#? string encryptedString = SomeStaticClass.Encrypt(sourceString); string decryptedString = SomeStaticClass.Decrypt(encryptedString)...
Richard's user avatar
  • 5,940
422 votes
9 answers
634k views

Java 256-bit AES Password-Based Encryption

I need to implement 256 bit AES encryption, but all the examples I have found online use a "KeyGenerator" to generate a 256 bit key, but I would like to use my own passkey. How can I create my own key?...
Nippysaurus's user avatar
  • 20.2k
420 votes
12 answers
235k views

What is the difference between encrypting and signing in asymmetric encryption? [closed]

What is the difference between encrypting some data vs signing some data (using RSA)? Does it simply reverse the role of the public-private keys? For example, I want to use my private key to ...
mmcdole's user avatar
  • 92.4k
322 votes
16 answers
160k views

What is the most appropriate way to store user settings in Android application

I am creating an application which connects to the server using username/password and I would like to enable the option "Save password" so the user wouldn't have to type the password each time the ...
Niko Gamulin's user avatar
  • 66.4k
317 votes
9 answers
825k views

How to use OpenSSL to encrypt/decrypt files?

I want to encrypt and decrypt one file using one password. How can I use OpenSSL to do that?
aF.'s user avatar
  • 66.2k
292 votes
24 answers
610k views

Is it possible to decrypt MD5 hashes?

Someone told me that he has seen software systems that: retrieve MD5 encrypted passwords from other systems; decrypt the encrypted passwords and store the passwords in the database of the system ...
John B's user avatar
  • 20.3k
283 votes
6 answers
392k views

Simplest two-way encryption using PHP

What is the simplest way of doing two way encryption in common PHP installs? I need to be able to encrypt data with a string key, and use the same key to decrypt on the other end. The security isn't ...
user1206970's user avatar
  • 2,857
279 votes
10 answers
617k views

How do you Encrypt and Decrypt a PHP String?

What I mean is: Original String + Salt or Key --> Encrypted String Encrypted String + Salt or Key --> Decrypted (Original String) Maybe something like: "hello world!" + "ABCD1234" --> ...
夏期劇場's user avatar
  • 18.2k
273 votes
11 answers
696k views

JavaScript string encryption and decryption?

I'm interested in building a small app for personal use that will encrypt and decrypt information on the client side using JavaScript. The encrypted information will be stored in a database on a ...
jeremiahs's user avatar
  • 4,075
266 votes
3 answers
138k views

What's the purpose of Django setting ‘SECRET_KEY’?

I did a few google searches and checked out the docs ( https://docs.djangoproject.com/en/dev/ref/settings/#secret-key ), but I was looking for a more in-depth explanation of this, and why it is ...
David542's user avatar
  • 109k
235 votes
5 answers
142k views

SHA512 vs. Blowfish and Bcrypt [closed]

I'm looking at hashing algorithms, but couldn't find an answer. Bcrypt uses Blowfish Blowfish is better than MD5 Q: but is Blowfish better than SHA512? Thanks.. Update: I want to clarify that I ...
Chris's user avatar
  • 8,806
220 votes
16 answers
680k views

Encrypt and decrypt using PyCrypto AES-256

I'm trying to build two functions using PyCrypto that accept two parameters: the message and the key, and then encrypt/decrypt the message. I found several links on the web to help me out, but each ...
Cyril N.'s user avatar
  • 39.6k
219 votes
8 answers
315k views

Best way to use PHP to encrypt and decrypt passwords? [duplicate]

Possible Duplicate: PHP 2-way encryption: I need to store passwords that can be retrieved I plan to store foreign account information for my users on my website, aka rapidshare username and ...
jiexi's user avatar
  • 3,019
205 votes
24 answers
109k views

Should I impose a maximum length on passwords?

I can understand that imposing a minimum length on passwords makes a lot of sense (to save users from themselves), but my bank has a requirement that passwords are between 6 and 8 characters long, and ...
nickf's user avatar
  • 543k
197 votes
22 answers
351k views

Simple way to encode a string according to a password?

Does Python have a built-in, simple way of encoding/decoding strings using a password? Something like this: >>> encode('John Doe', password = 'mypass') 'sjkl28cn2sx0' >>> decode('...
RexE's user avatar
  • 17.5k
194 votes
2 answers
90k views

gnupg: There is no assurance this key belongs to the named user

I'm trying to use interesting password management tool named Pass. I did the following: Installed gpg tool $ sudo dnf install gpg Generated a key using $ gpg --gen-key Typed $ pass init "foobar ...
Ivan Talalaev's user avatar
193 votes
13 answers
186k views

How to convert SecureString to System.String?

All reservations about unsecuring your SecureString by creating a System.String out of it aside, how can it be done? How can I convert an ordinary System.Security.SecureString to System.String? I'm ...
Andrew Arnott's user avatar
187 votes
11 answers
47k views

When would I need a SecureString in .NET?

I'm trying to grok the purpose of .NET's SecureString. From MSDN: An instance of the System.String class is both immutable and, when no longer needed, cannot be programmatically scheduled for ...
Richard Morgan's user avatar
183 votes
14 answers
194k views

How do you test a public/private DSA keypair? [closed]

Is there an easy way to verify that a given private key matches a given public key? I have a few *.puband a few *.key files, and I need to check which go with which. Again, these are pub/key files, ...
Loki's user avatar
  • 6,251
183 votes
16 answers
521k views

How to encrypt String in Java

What I need is to encrypt string which will show up in 2D barcode(PDF-417) so when someone get an idea to scan it will get nothing readable. Other requirements: should not be complicated it should ...
ante.sabo's user avatar
  • 3,201
183 votes
3 answers
409k views

RSA Public Key format

Where can i find some documentation on the format of an RSA public key? An RSA public key formatted by OpenSSH: ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQB/nAmOjTmezNUDKYvEeIRf2YnwM9/uUG1d0BYsc8/tRtx+...
Ian Boyd's user avatar
  • 253k
182 votes
10 answers
270k views

Hash function that produces short hashes?

Is there a way of encryption that can take a string of any length and produce a sub-10-character hash? I want to produce reasonably unique ID's but based on message contents, rather than randomly. I ...
user avatar
181 votes
11 answers
125k views

Difference between encoding and encryption

What is the difference between encoding and encryption?
Pankaj Agarwal's user avatar
177 votes
6 answers
102k views

What is the purpose of base 64 encoding and why it used in HTTP Basic Authentication?

I don't get the Base64 encryption. If one can decrypt a Base64 string, what is it's purpose? Why is it being used for HTTP Basic auth? It's like telling to someone my password is reversed into ...
ajsie's user avatar
  • 79.2k
175 votes
8 answers
73k views

Two-way encryption: I need to store passwords that can be retrieved

I am creating an application that will store passwords, which the user can retrieve and see. The passwords are for a hardware device, so checking against hashes are out of the question. What I need ...
HyderA's user avatar
  • 21.1k
174 votes
2 answers
190k views

What are the differences between .pem, .cer and .der?

What are the differences between .pem, .cer and .der? As far as I know, .cer contains public key. Are there any open frameworks that I can use to encrypt my data using this public key?
LiangWang's user avatar
  • 8,576
174 votes
9 answers
313k views

SQLite with encryption/password protection

I'm just learning to use SQLite and I was curious if such is possible: Encryption of the database file? Password protect opening of the database? PS. I know that there is this "SQLite Encryption ...
ahmd0's user avatar
  • 17.1k
164 votes
5 answers
125k views

encryption/decryption with multiple keys

Is it possible to encrypt data, such that it can be decrypted with several different keys? Example: I've encrypted data with key1, but I want to be able to decrypt with keys 2, 3, and 4. Is this ...
Glen Solsberry's user avatar
161 votes
9 answers
153k views

Difference between Hashing a Password and Encrypting it

The current top-voted to this question states: Another one that's not so much a security issue, although it is security-related, is complete and abject failure to grok the difference between ...
Claudiu's user avatar
  • 227k
160 votes
16 answers
357k views

Converting a Java Keystore into PEM Format

I am trying to convert from a Java keystore file into a PEM file using keytool and openssl applications. However, I could not find an ideal way to do the conversion. Any thoughts? Instead of ...
Chathuranga Chandrasekara's user avatar
154 votes
7 answers
495k views

Given final block not properly padded

I am trying to implement password based encryption algorithm, but I get this exception: javax.crypto.BadPaddingException: Given final block not properly padded What might be the problem? Here is ...
Altrim's user avatar
  • 6,716
145 votes
4 answers
32k views

How to encrypt bytes using the TPM (Trusted Platform Module)

How can I encrypt bytes using a machine's TPM module? CryptProtectData Windows provides a (relatively) simple API to encrypt a blob using the CryptProtectData API, which we can wrap an easy to use ...
Ian Boyd's user avatar
  • 253k
142 votes
10 answers
238k views

Encrypt password in configuration files [closed]

I have a program that reads server information from a configuration file and would like to encrypt the password in that configuration that can be read by my program and decrypted. Requirements: ...
Petey B's user avatar
  • 11.5k
141 votes
6 answers
252k views

Converting Secret Key into a String and Vice Versa

I am generating a key and need to store it in DB, so I convert it into a String, but to get back the key from the String. What are the possible ways of accomplishing this? My code is, SecretKey key =...
Princeyesuraj's user avatar
137 votes
8 answers
173k views

I need to securely store a username and password in Python, what are my options? [closed]

I'm writing a small Python script which will periodically pull information from a 3rd party service using a username and password combo. I don't need to create something that is 100% bulletproof (does ...
Naftuli Kay's user avatar
  • 90.3k
136 votes
7 answers
202k views

How does BitLocker affect performance? [closed]

I'm an ASP.NET / C# developer. I use VS2010 all the time. I am thinking of enabling BitLocker on my laptop to protect the contents, but I am concerned about performance degradation. Developers who use ...
Christopher's user avatar
  • 10.6k
134 votes
9 answers
182k views

How to send password securely over HTTP?

If on a login screen user submits a form with their username and password, the password is sent in plain text (even with POST, correct me if I am wrong). What is the right way to protect the user and ...
Kornelije Petak's user avatar
131 votes
3 answers
151k views

What is the meaning of ToString("X2")? [duplicate]

I'm studying MD5 encryption, and have found this code using Google: public string CalculateMD5Hash(string input) { // Primeiro passo, calcular o MD5 hash a partir da string MD5 md5 = System....
Lai32290's user avatar
  • 8,438
129 votes
3 answers
274k views

Remove 'b' character do in front of a string literal in Python 3 [duplicate]

I am new in python programming and i am a bit confused. I try to get the bytes from a string to hash and encrypt but i got b'...' b character in front of string just like the below example. Is any ...
Panagiotis Drakatos's user avatar
127 votes
5 answers
146k views

AES Encryption for an NSString on the iPhone

Can anybody point me in the right direction to be able to encrypt a string, returning another string with the encrypted data? (I've been trying with AES256 encryption.) I want to write a method which ...
Boz's user avatar
  • 1,646
127 votes
10 answers
224k views

mcrypt is deprecated, what is the alternative?

The mcrypt-extension is deprecated will be removed in PHP 7.2 according to the comment posted here. So I am looking for an alternative way to encrypt passwords. Right now I am using something like ...
Piet's user avatar
  • 2,198
120 votes
6 answers
243k views

How to encrypt/decrypt data in php?

I'm currently a student and I'm studying PHP, I'm trying to make a simple encrypt/decrypt of data in PHP. I made some online research and some of them were quite confusing(at least for me). Here's ...
Randel Ramirez's user avatar
120 votes
14 answers
242k views

Javascript AES encryption [closed]

Is there a library available for AES 256-bits encryption in Javascript?
coder's user avatar
  • 2,249
119 votes
10 answers
486k views

Initial bytes incorrect after Java AES/CBC decryption

What's wrong with the following example? The problem is that the first part of the decrypted string is nonsense. However, the rest is fine, I get... Result: `£eB6O�geS��i are you? Have a nice day. @...
TedTrippin's user avatar
  • 3,592
116 votes
6 answers
136k views

What is the difference between DSA and RSA?

It appears they are both encryption algorithms that require public and private keys. Why would I pick one versus the other to provide encryption in my client server application?
WilliamKF's user avatar
  • 42.4k

1
2 3 4 5
746