Questions tagged [symmetric-key]

algorithms are algorithms for cryptography that use the same cryptographic keys for both encryption of plaintext and decryption of ciphertext. The keys may be identical or there may be a simple transformation to go between the two keys.

as stated in Wikipedia.

Since this tag is used in its general meaning, it would be a good idea to use one or more tags too, to describe your specific case better.

83 questions
3
votes
1 answer

32-character PHP AES Key for mcrypt_encrypt

Consider the following PHP code:
rames44a
  • 61
  • 1
  • 6
3
votes
2 answers

SQL Server 2008 + PCI Compliance? Pertains to PCI, as well as Symmetric keys!

I've never had to deal with PCI compliance before. I've been reading their documentation and it says I need to protect the credit card number, expiration date and the card holder's name. No storage of security codes ever. In their documentation,…
Gromer
  • 9,861
  • 4
  • 34
  • 55
3
votes
4 answers

SQL Symmetric Key and opening it from C#

I am trying to encrypt data in SQL Server via a Symmetric key. When a user submits data through a web form, I would like for the data to be encrypted, using my Symmetric Key that I have saved inside the SQL Server. I am trying to find out how to do…
Tomasz Iniewicz
  • 4,379
  • 6
  • 42
  • 47
3
votes
1 answer

Why does changing one bit in a Triple DES key or initial value not give different encrypted data?

I'm using pyDes to encrypt some data. I wanted to demonstrate that if you change even one bit in the key or initial value, the encrypted data would be totally different. I set up the 16-byte key to change the last character by +/- 1, causing at…
Mark Rushakoff
  • 249,864
  • 45
  • 407
  • 398
2
votes
1 answer

Symmetric key creation with CKA_SENSITIVE false and CKA_PRIVATE as true

I am working on a cloud HSM service and I see CKA_ATTRIBUTE_INVALID error when I am trying to create a AES 256 key with following…
Zach
  • 35
  • 6
2
votes
0 answers

How can I Decrypt using libsodiumWrapper library using a public and a private key?

I am trying to decrypt a encrypted hash string using a public and a private key.As I am new to this sodium library I do not know much. I have tried every possible way .But I am getting error. I have tried converting it to Uint8Array but it didnt…
2
votes
3 answers

How do you protect your JWT Symmetric Security Key?

In my production env right now I have my key hard coded: new SigningCredentials(new SymmetricSecurityKey("my jey bla bla"), SecurityAlgorithms.HmacSha256Signature); Moving the key to a config file is a bad idea, placing it here is even worst. What…
SexyMF
  • 10,657
  • 33
  • 102
  • 206
2
votes
1 answer

If we wrap a 256 bit AES key with AES key, then size of a wrapped key can be more than 32 bytes?

I have a piece of code where I wrap my symmetric key(AES) with AES key: swkKey: this is the AES key used for wrapping. key: the key to be wrapped. Code: SecretKey swkKeySpec = new SecretKeySpec(swkKey, 0, swkKey.length, "AES"); Cipher cipher =…
Vikas Rai
  • 87
  • 12
2
votes
1 answer

How to encrypt/decrypt data in some columns of a table and when a new record gets inserted it should also get encrypt

i know like this to insert a new record INSERT INTO dbo.Customer_data (Customer_id, Customer_Name, Credit_card_number) VALUES (25665, 'mssqltips4', EncryptByKey( Key_GUID('SymmetricKey1'), CONVERT(varchar,'4545-58478-1245') ) ); but i want to…
adams
  • 181
  • 3
  • 16
2
votes
0 answers

Nodejs, Crypto: Encrypting multiple strings using same cipher

I am trying to encrypt multiple strings using same cipher with the code var iv = _crypto.randomBytes(16).slice(0, 12); var salt = _crypto.randomBytes(64); var key = _crypto.pbkdf2Sync(symmetricKey, salt, 2145, 32, 'sha512'); var cipher =…
2
votes
1 answer

Hibernate/JPA and MS SQL Server - Open Symmetric Key before DecryptByKey

In a SQL Server 2012 database, I have a table with a varbinary(128) column that stores data encrypted by a certificate (AppCert) backed key (Secret_Key) and authenticator using a SHA2_512 hash of the primary key: CREATE TABLE [Lookup].[SecretStuff]…
Rob Streeter
  • 187
  • 3
  • 12
2
votes
1 answer

OpenSSL EVP API: How to decrypt the encrypted file using a symmetric key file

Hi I'm working on C on Linux. I have a query related to symmetric key decryption. I have generated an symmetric key using the below command. openssl rand base64 512 > sym.key Using this key (sym.key) I have encrypted a file with below…
Sai
  • 931
  • 1
  • 7
  • 6
2
votes
2 answers

Tips to generate strong RSA keys

Is there any documentation including tips to generate strong RSA key? I mean not just ' use XXX utility with -X flag'. I mean some rules in theory. For example, module n should be not less then 1024 bit, etc. Can anybody tell me?
veitr
  • 111
  • 10
1
vote
1 answer

SQL Server 2008 R2 User Permissions

I have a user whose role is db_datareader that needs to be able to execute a stored procedure which decrypts some data using our symmetric key and certificate. I've granted EXECUTE perms on the stored procedure itself for this user, but now it…
Code Maverick
  • 20,171
  • 12
  • 62
  • 114
1
vote
2 answers

How to avoid a shared symmetric key and its maintenance issues?

A business partner has implemented the following: Website A uses a symmetric key to encrypt user contact data. Website A redirects to 3rd party Website B with encrypted data in querystring. Website B decrypts data and uses it to resume…
frankadelic
  • 20,543
  • 37
  • 111
  • 164