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
1
vote
1 answer

Incorrect AES key length (89 bytes)

Can someone please guide us what we might be doing wrong here? The code crashes with "raise ValueError("Incorrect AES key length (%d bytes)" % len(key)) ValueError: Incorrect AES key length (89 bytes)" Note: The file symmetric_key.txt contains the…
1
vote
1 answer

Storing symmetric key for rest of the database while encrpted in the database itself

Following up on my question here I now need to store the symmetric key safely. After reviewing options it sounds like this may be a good option: Set up: There is a table in the DB that has two fields php_key - stores a symmetrically encrypted…
1
vote
1 answer

Key store implementations allowing storing attributes with the key's value?

I was wondering if there are any key store implementations out there that allow to store key attributes, say as name/value-pairs, along with a symmetric key's value? Looks like JKS and JCEKS only allow storing the key value and the key's alias, so…
rbnbrtls
  • 11
  • 3
1
vote
2 answers

How to split 3DES key and calculate KCV in C#?

I have a 128 bit 3DES key 1915372928A30803A25B0659A4DD6525, how could I split the key into 3 components and calculate the KCV for each component? I'd like to do similarly to the online tool…
Asvey
  • 11
  • 3
1
vote
1 answer

What's the purpose of a password in symmetric cryptography?

I found the Python package to encrypt some data and see this in python Cryptography: It is possible to use passwords with Fernet(symmetric key). To do this, you need to run the password through a key derivation function such as PBKDF2HMAC, bcrypt…
WeiChing 林煒清
  • 4,452
  • 3
  • 30
  • 65
1
vote
1 answer

C# AES-256 Unicode Key

I need to make strong key for AES-256 in a) Unicode characters, b) key in bytes. a) I have to generate 50 random Unicode characters and then convert them to bytes. Is this possible to use Unicode characters as AES256 key? For e.g. I want to use this…
1
vote
2 answers

How can I select the strength of my AES encryption i.e 128, 256, 512 etc.?

Below is an example of how I am encrypting text in java, although the encryption works. I can't seem to figure out how I can modify the level of encryption i.e 128, 256, 512 etc. Code: byte keySelectedByUser[] = selectedKey.getBytes(); SecretKeySpec…
Screen
  • 11
  • 1
1
vote
1 answer

Java aes key to 32byte string representation

How can this be done? I want to take the resulting aes secretkey and turn it into the plaintext 16byte representation public SecretKey generateAesKey() throws NoSuchAlgorithmException{ KeyGenerator keygen; …
user3746744
  • 433
  • 1
  • 4
  • 10
1
vote
1 answer

Can array of bytes be used as a key with CryptoJS.RC4.encrypt?

I need to use an array of bytes (non-printable characters) as a key for RC4 encryption. The plaintext is a string. It seems that CryptoJS.RC4.encrypt expects only strings for both plaintext and key. Am I correct? If not, how do I call encrypt()…
bdristan
  • 1,048
  • 1
  • 12
  • 36
1
vote
1 answer

Where do I get AES Key Schedule encryption key?

I have implemented AES key schedule in Java but there is one thing I am confused about. In wikipedia (http://en.wikipedia.org/wiki/Rijndael_key_schedule#Key_schedule_description) it says: The first n bytes of the expanded key are simply the…
raptor
  • 117
  • 1
  • 8
1
vote
1 answer

Does it matter whether secured communication using symmetric/ pre-shared keys is happening over normal Socket or SSLSocket? How?

If I am using any of the TLS_PSK_* cipher suites, then all I need to use some pre-shared key among client and server for encrypting and decrypting the message. Would it matter whether I am sending the encrypted message over normal Socket or…
Manojkumar Khotele
  • 963
  • 11
  • 25
1
vote
0 answers

Implement SSL in java without certificates

Is it possible to implement SSL encryption by using pre-distributed keys (secret keys) in Java? If at all possible, I want to avoid certificates. This should work, as certs are used for authenticating site validity. Am I correct or wrong in…
Kyte
  • 834
  • 2
  • 12
  • 27
1
vote
1 answer

Storing a symmetric key in OS X keychain programmatically

I have a symmetric key which I want to store in the OS X keychain. Storing passwords and usernames are working perfectly, so I changed My code to store a symmetric key which I want to use later by My app. I used the following code which give Me as…
Eurobertics
  • 66
  • 1
  • 8
1
vote
2 answers

When a transformation of the key is needed, how can the key be symmetric?

I am learning about Cryptography, and I came across following statement on Wikipedia: The keys may be identical or there may be a simple transformation to go between the two keys. When a transformation of the key is needed, how can the key be…
Pranit Kothari
  • 9,721
  • 10
  • 61
  • 137
1
vote
1 answer

Can I extract symmetric key in java SSLSocket class?

how can I get session symmetric key in Java? Is it hidden? (Looked for methods but there were none) That would make sense, however, I still need it. Is there a way to retrieve the symmetric key?
Vanilla Face
  • 908
  • 1
  • 7
  • 17