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

Symmetric Encryption between .NET and Java

I am using a 3rd party platform to create a landing page, it is a business requirement that I use this particular platform. On their page I can encrypt data and send it to my server through a request parameter when calling a resource on my site.…
Dominic
  • 1,294
  • 1
  • 15
  • 29
3
votes
3 answers

Why is my Decrypt Method throwing a "Length of the data to decrypt is invalid" Cryptographic Exception

This is a really common exception, but obviously none of the solutions I've found have resolved my issue. I have an Encrypt and a Decrypt method; I encrypt a string and write it to a file, then read the string from the file and decrypt it (in…
Scott Baker
  • 10,013
  • 17
  • 56
  • 102
3
votes
2 answers

Is that OK to use static IV value in Rijndael encryption for many files?

I have a question about IV in Rijndael encryption. My current approach of using Rijndael is to use a pair of static Key and Iv for all encryption operations (I mean I use this pair of Key and Iv for all protected files in my computer). I heard that…
user774411
  • 1,749
  • 6
  • 28
  • 47
3
votes
0 answers

Is it possible to encrypt a message outside of AWS KMS using a "key material" and decrypt using KMS?

I have created a custom managed symmetric key (for encryption / decryption purposes) in AWS KMS and imported my own key material from an external source. For symmetric keys, AWS KMS uses the AES-256-GCM algorithm spec. What I am trying to understand…
3
votes
0 answers

Android: Implementing AES_256/GCM/NoPadding with 16byte iv on api 21+

I am trying to implement AES_256/GCM/NoPadding with 16byte iv on api 21+. I have kotlin code which works on desktop but throws exception InvalidAlgorithmParameterException: Expected IV length of 12 but was 16. I checked it on emulator with API level…
3
votes
3 answers

BinaryFormatter & CryptoStream problem when deserializing

I'm getting a bit desperate here. I'm trying to write an encrypted file with a serialized object to disk and later retrieve the file, decrypt it and deserialize the object back. UPDATE: I refactored the code to this: using (Stream innerStream =…
hoetz
  • 2,368
  • 4
  • 26
  • 58
3
votes
1 answer

Fetching Encrypted Buffer Data to use as ArrayBuffer for client-side decryption

I am attempting to fetch encrypted raw buffer data (AES-256) from Arweave, pass to a decrypt function and use this to display an image. I am trying to fetch and decrypt the ArrayBuffer on the front end (in my React app). First, I am encrypting the…
3
votes
1 answer

How do I correctly store encryption keys on macOS so only my executable can access them?

Introduction Basically, how/where do I persist encryption keys my executable needs? Let me explain how my executable looks like. It's basically a Swift script that is compiled using swift build --configuration=release…
swift-lynx
  • 3,219
  • 3
  • 26
  • 45
3
votes
1 answer

Data encryption in application cluster

I have a web application accessed over SSL. To beef up security on the back end we are looking at adding in symmetric encryption for the database. The application is spread across 6 servers in a websphere cluster. We were looking at a simple model…
Keibosh
  • 1,237
  • 1
  • 9
  • 18
3
votes
2 answers

java.security.InvalidKeyException: Key length not 128/192/256 bits

I am new to Java and was trying to use Hybrid cryptography using AES-128 Symmetric encryption and then RSA-1024 Asymmetric encryption on the generated symmetric key. Can someone help why I am getting this exception. I have already followed the other…
3
votes
4 answers

Is there two key symetric commutative encryption function?

I'm wondering if there is some strong (like AES or so.) encryption function that works like this: symetric 2 keys: plaintext -> 2keys ->ciphered text, however it must not matter order of keys, i.e Key1 (Key2 (plaintext)) == Key2…
kleofas
  • 417
  • 1
  • 5
  • 5
3
votes
1 answer

Password as key for AES Encryption/Decryption

I'm working on a project where I have to encrypt and decrypt chosen files by user. How can I use a password from user as a key for AES encryption/decryption? Right now they can enter passwords of 8 or 16 characters long. I don't want to force the…
zalaw
  • 33
  • 1
  • 3
3
votes
1 answer

openssl EVP_CipherFinal_ex failed

I got this below function file_encrypt_decrypt for encryption and decryption of a file using AES256 CBC from here. If I'm doing encryption and decryption both from same program, (main function given at the end) encryption and decryption is working…
RatDon
  • 3,403
  • 8
  • 43
  • 85
3
votes
1 answer

How should I derive the key and initialization vector for my AES encrypted database entries?

I've built a CMS system to allow users to create and manage online forms on my client's intranet app. Of course some of the data handled by the forms may need to be encrypted e.g. if the system is used to build a form that handles salary specifics…
immutabl
  • 6,857
  • 13
  • 45
  • 76
3
votes
2 answers

Disadvantage of using Amazon KMS to encrypt / decrypt small application data

A pair of Amazon Lambdas will symmetrically encrypt and decrypt a small piece of application data. I want to use Amazon KMS to facilitate this, because it solves the problems of secret storage and key rotation, and then some. The Amazon KMS…
Daniel B.
  • 1,650
  • 1
  • 19
  • 40