Questions tagged [encryption-symmetric]

A type of encryption where the same key is used to encrypt and decrypt the message.

Symmetric encryption is the oldest and best-known technique. A secret key, which can be a number, a word, or just a string of random letters, is applied to the text of a message to change the content in a particular way. This might be as simple as shifting each letter by a number of places in the alphabet (known as the Caesar Cipher), or as complicated as the Advanced Encryption Standard, which is used in some modern cryptography. Anyone who knows the key can either encrypt or decrypt a message.

Note that symmetric encryption does not require that the encryption and decryption key be identical, but rather that both keys derive from the same knowledge. For example, a letter-shifting cipher might require that "A" be enciphered as "G" - the opposite operation would be needed to decrypt.

736 questions
4
votes
2 answers

BadPadding exception when trying to decrypt AES based encrypted text

Problem Scenario: I am creating an encrypted file using OpenSSL AES-256-CBC mode in Ubuntu. openssl aes-256-cbc -a -in avengers.txt -out avengers.enc test test File Content: avengersAssemble avengers.enc file content:…
4
votes
1 answer

Decrypt Rijndael 256 Block Size with BouncyCastle

We have a helper class for doing encryption that, if I'm going to be honest, was probably copied from Stack Overflow years ago. Currently we're trying to port some of this code to .NET Core and we're finding that it doesn't work because the .NET…
Pharylon
  • 9,796
  • 3
  • 35
  • 59
4
votes
2 answers

How strong is this hashing technique?

Use AES/Rijndael or any symmetric encryption. Encrypt the hidden value using itself as the key and a random IV. Store the ciphertext + IV. Discard everything else. To check the hash: try to decrypt using provided plaintext. If provided ==…
Félix Saparelli
  • 8,424
  • 6
  • 52
  • 67
4
votes
1 answer

max plaintext size for Android Keystore symmetric encryption?

I'd like to use the Android Keystore to do symmetric AES encryption of large (multi MB) data files. I've written demo code that will encrypt/decrypt multi-KB files with the Keystore, but when the file size gets too large it starts to fall down. …
paleozogt
  • 6,393
  • 11
  • 51
  • 94
4
votes
2 answers

Can we use the key as the IV for AES?

I wish to be more efficient in generating a random key and a random IV for the encryption. But is it workable and safe to use the random key as the IV?
Chong Lip Phang
  • 8,755
  • 5
  • 65
  • 100
4
votes
0 answers

Why PBKDF2 SHA256 generated hash value not equal between C and java

I have a Android client and Server, the client needs to validate the session key before communication or processing data with the server. The client was Android app and its encryption method was wrote in Java, the server`s was wrote in C. I call the…
Logan Guo
  • 865
  • 4
  • 17
  • 35
4
votes
1 answer

File handling messes with symmetric client-server communication

I have written two programs that implement server-client communication with symmetric encryption. They seem to do their job: the client asks for a message,encrypts it with an AES_key, sends it to the server, which decrypts it and sends it back. …
blindeyes
  • 409
  • 3
  • 13
4
votes
1 answer

Calculation of encrypted file size does not match true size

I have the need to calculate the size of a file I am encrypting using Rijndael. According to other answers on this site, and on google, the following is the correct way of calculating encrypted data length: EL = UL + (BS - (UL Mod BS) Mod…
Sk93
  • 3,676
  • 3
  • 37
  • 67
4
votes
2 answers

"Invalid use of a side-effecting operator 'OPEN SYMMETRIC KEY' within a function." error while opening a symmetric key

I am trying to open symmetric key inside two functions. Like this: CREATE FUNCTION DECRYPTDATA ( @CipherText NVARCHAR(MAX) ) RETURNS NVARCHAR(MAX) AS BEGIN DECLARE @Result NVARCHAR(MAX) OPEN SYMMETRIC KEY MyKEY DECRYPTION BY CERTIFICATE…
4
votes
1 answer

Symmetric encryption issue between a .Net application and a Java application

I am integrating with a .Net application which uses Symmetric encryption. My application is on Java. Following is the .Net code which was shared by the team which uses the Symmetric encryption; public static string SymmetricEncrypt(string value,…
dinukadev
  • 2,279
  • 17
  • 22
4
votes
4 answers

Spring Cloud Config Server - Where to set encrypt.key to enable /encrypt endpoint

I have a Spring Cloud Config app with the Spring Cloud Security dependencies. I'm trying to hit the /encrypt endpoint to encrypt a password. According to the docs at…
Ken Krueger
  • 1,005
  • 14
  • 26
4
votes
3 answers

Is this wrapper around AesManaged ok?

I need to encrypt/decrypt some strings. I've build my wrapper class according to the msdn documentation but with some changes. Since I want to encrypt/decrypt data with a given string/passphrase, I don't use AesManaged for creating a key. (The user…
Manuel
  • 1,985
  • 3
  • 31
  • 51
4
votes
1 answer

Where is SSL symmetric key stored?

Here is what I understand on SSL communication: The browser gets public key from the web server of the secured website. The client and server establish session key based on public/private keys and then continue communication through symmetric…
George Sun
  • 881
  • 1
  • 10
  • 20
4
votes
2 answers

Using Coldfusion's Encrypt function to encrypt a hex block and return a block-length result

My company is working on a project that will put card readers in the field. The readers use DUKPT TripleDES encryption, so we will need to develop software that will decrypt the card data on our servers. I have just started to scratch the surface on…
4
votes
1 answer

SQL Server 2008 R2 Encryption Issue, when Decrypts Show Special Characters

I am a quite new to SQL Server encryption and I need to encrypt some columns of my database. I managed to create the Master Key, Certificate, Symmetric key and encrypt my column, but when I decrypt it, it shows some characters similar to Chinese,…