Questions tagged [encryption-symmetric]

1

votes
0

answer
10

Views

Encryption using symmetric openssl aes-128-cbc SHA256 encryption

Problem: Want to achieve symmetric encryption using openssl aes-256-cbc -a -in avengers.txt -out avengers.enc -md md5 so if I pass the encrypted text in below code or in openssl aes-256-cbc -a -d -in avengers.enc -md md5 I get the actual strong. Can anyone help me in factoring the below code to do e...
QubesX
1

votes
1

answer
3.3k

Views

AES and its cipher modes

I was trying encryption/decryption with AES then I tried the CBC & ECB modes I got the same encrypted output from all three ! is this how it goes? it's may not be wrong but I just don't know what to expect . and what's the point of having modes if they all produce the same cipher ? is it time or pe...
Katia
1

votes
2

answer
705

Views

Get cipher used to password encrypt private key

I have a private key used for RSA exchanges that is password protected. I know the password, so I can use the key, however, I do not know which cipher was used to do the password. I have other keys where the cipher is named in a header in the decrypted key, as per the answer to this question. Howe...
1

votes
2

answer
872

Views

PHP MYCRYPT - RIJNDAEL_128 with Mcrypt CBC gives the different encryption string everytime

I am back again with a PHP+RIJNDAEl_128+CBC. I am successful in encryption and decryption to the raw string. But the only problem I am facing is I get the DIFFERENT ENCRYPTION string every time. Which I believe should be same every time ideally. Below is the code: class Encypt{ const ENCRYPTION_KEY...
Padyster
1

votes
2

answer
93

Views

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

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 symmetric? More precisely, doesn't "symmetric" mean "same...
Pranit Kothari
1

votes
1

answer
1.3k

Views

Best method to communicate securely between two different servers

I'm trying to figure out the best way to send info back and forth between my server and another company's server. Basically, the other company processes the sales of my software, then goes to my server to activate the software. My software hits my server every time it loads to get the activated li...
Brad
3

votes
1

answer
1.3k

Views

How To Decrypt AWS Ruby Client-side Encryption in Python

AWS's S3 SDK for Ruby allows for client-side ('envelope') encryption of the file. It's a combination of AES CBC/ECB encryption for the client-side key where the envelope key and initialization vector are stored in the metadata. I have a Ruby developer that has encrypted various files in an S3 buc...
lycovian
1

votes
1

answer
4.7k

Views

base64 InvalidKeyException: Key length not 128/192/256 bits

I am trying to encrypt editText strings using Base64 wnich will be saved in sharedpreferences but once the strings are encoded and saved my .xml file is blank. I am a novice programmer and very new to encrytion so Im lost and do not know how to properly analyze my code to determine the problem which...
sean
1

votes
2

answer
5.2k

Views

Padding in AES CBC

I am trying to test CBC with Random IV using (128-bit AES) in C#. In my question to solve, I have 12-byte input message. The condition is that if PlainText is less than block-size (16-bytes) the padding to be used starts with 0x01 and then upto 6 0x00. Example: in ASCII PT = Pay Bob 100% in hex...
Khurram Majeed
18

votes
8

answer
23.8k

Views

Simple Encryption in Ruby without external gems

I need a simple encryption for some text strings. I want to create coupon codes and make them look cool so subsequently created code should look very different. (And besides looking cool, it shouldn't be easy to guess a code.) But I want to be able to decrypt them again. So the algorithm must be rev...
Philip
1

votes
2

answer
4.8k

Views

How to encrypt/decrypt for storage of sensitive data (ASP.NET Web API project)

I am currently developping a web service. As part of this web service, I am be able to securely store user password in a SQL DB, and be able to unencrypt password value to the end-user through HTTPS web service. It's the first time I have to deal with this requirement. I found many example based on...
sylbae
5

votes
1

answer
580

Views

AES encryption on iOS and android, output and buffer size is different

Implementing AES256 on iOS using CCCrypt function. But output and output buffer length is different than Android. Cipher class in Android produces 48 bytes data where in iOS we get 80 bytes data. In IOS using kCCAlgorithmAES, kCCOptionPKCS7Padding and in android using AES/CBC/PKCS5Padding. in IOS...
Pradip
1

votes
2

answer
1.6k

Views

DES encryption plain vs. cipher length

I am using Java to make a toy program that encrypts a message using DES encryption. The message I want to encrypt is: String msg="This is a secret message"; Which I convert to bytes as: byte [] msgBytes=msg.getBytes(); And send it to encrypt function that works as follows: //encryption function publ...
user2192774
1

votes
1

answer
845

Views

Encryption in ASP.NET that can be decrypted in MySQL with AES_DECRYPT()

I would like to be able to perform application-level encryption in ASP.NET, producing an array of bytes that would then be saved to a MySQL blob column. I would then like it to be an option that, if you have the encryption key, you would be able to decrypt it using MySQL's AES_DECRYPT() function....
ilasno
1

votes
1

answer
45

Views

Possible ways to attach IV to the encrypted string

What are the possible ways to attach the iv to the encrypted string. Prepending iv as the first sixteen is the most common approach. Are there any other ways can we able to do it?
Dency G B
6

votes
4

answer
392

Views

Preventing MITM attacks on server

Two clients Alice and Bob use a server to login and exchange messages through the server. On login, they both send their public keys to be stored on the server. When Alice wants to speak to Bob, she enrypts a symmetric key with Bob's public key and sends it to Bob through the server. How can I make...
Vladimir
5

votes
5

answer
17.3k

Views

generating AES 256 bit key value

Does anyone know of a way to get a 256 bit key value generated from a pass phrase of any length? The encryption cannot be salted as the encrypted values need to be generated again and compared in the database. So a value must generate the same encrypted string each time it is encrypted. Currently I'...
bhs
5

votes
1

answer
1.4k

Views

How to manage secret Key in java

I am developing a Java cryptography application. I want to encrypt a file using symmetric algorithms such as AES or DES and store the secretKey in a database for future decryption of the file. I am wondering how to store the SecretKey object in a database table. Should I serialize the key object? (s...
Lokesh Kumar
2

votes
4

answer
5.5k

Views

Simple algorithm for encrypting with Javascript and decrypting with C#

I want to encrypt some text in URL with a simple java-script algorithm and then decrypt it at code behind of an ASP.NET page using C#. ROT13 is a good choice but unfortunately I cannot use it due to some confidential details. Anything like that would help but I don't know the famous ones. Security i...
Xaqron
2

votes
1

answer
161

Views

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, string PrivateKey, string SALT_STRING) where T : Symme...
dinukadev
4

votes
2

answer
2.6k

Views

Best way to search encrypted data inside MySQL

I am encrypting using PHP before saving the encrypted data to MySQL. I am convinced this is a better way in the long run vs using MySQL's AES_* functions. My question now is, is there an efficient way to search encrypted data aside from storing a searchable hashed version of the data? E.g., Two colu...
IMB
1

votes
3

answer
155

Views

Symmetric cryptography and salt

I need to encrypt two-way (symmetric) distinct tokens. These tokens are expected to be repeated (e.g. They are people first names), but I do not want an attacker to conclude which encrypted tokens came from the same original tokens. Salt is the way to go for one-way cryptography (hashing). Is there...
yannisf
2

votes
2

answer
1.5k

Views

Encrypting/decrypting large files with PyCrypto - strategies

Im currently trying to learn some stuff about encryption, it's algorithms and how it works in general. I was thinking about a way to go for encrypting large files and the only way feasible to me seems using a symmetric key algorithm. So i was looking at AES, and while passing 64k or 32k blocks of b...
omu_negru
2

votes
3

answer
2.2k

Views

How do encryption algorithms know if they have the right key

I know it is a bad idea to try to implement your own encryption algorithms. Here is one reason why I think it is not: For example let's say I want to send plainText = new byte[]{2,5,1,6,7} to bob. If I use AES encryption or another well know algorithm then I will have: cipherText = Aes.Encrypt(plai...
Tono Nam
5

votes
1

answer
4.1k

Views

AES encryption with BouncyCastle: AESEngine, AESFastEngine OR AESLightEngine?

I want to port this simple JAVA example... AES Encryption/Decryption with Bouncycastle Example in J2ME ...to C# and have the two following 3 questions: As I understand, the JAVA example uses AESEngine for encryption/decryption operations. What is the difference between AESEngine and AESFastEngine an...
Mike
2

votes
3

answer
6.3k

Views

Encryption algorithm preferably having an implementation in java

I am looking for a symmetric key encryption scheme which would encrypt my 12 byte data. As you can see it does not conform to 64 bit or 128 bit boundaries for me to use block ciphering algorithms and I do not want to pad the data as I have restriction on the length of encrypted data. The restriction...
learningtocode
11

votes
4

answer
18.8k

Views

Which symmetric key algorithm does SSL use?

I understand that through SSL, the browser gets the public key of the secured website and through public key encryption rsa algorithm, these 2 establish session key and then continue communication thru some symmetric algorithm, because symmetric key encryption/decryption is faster. Which symmetric k...
xyz
5

votes
1

answer
1.4k

Views

How to write encrypted data to a text file?

I have a project where we write a small amount of data to a file every 5 minutes. The idea is to look at how this data changes over a period of hours, days, and weeks. One of the requirements is to store this data in a secure format. We already have an encryption scheme for sending this data across...
Kyte
3

votes
4

answer
4.9k

Views

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 http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_key_management I believe I need to set a symmetric key using "en...
Ken Krueger
4

votes
3

answer
11.9k

Views

Occasional Bad Data Error while decrypting the string : System.Security.Cryptography.CryptographicException

In my ASP.NET WebForms App (The app is running on windows server 2008 R2, IIS 7.5 and Runtime v4.0 Integrated Mode App Pool if it matters), I am encrypting data, putting it on the QueryString and decrypting data using System.Security.Cryptography.SymmetricAlgorithm class. But I am occasionally havin...
tugberk
1

votes
2

answer
150

Views

Why is it impossible to implement an “infinite” one time pad algorithm?

I've done some research into this, but I'm still not sure why this cannot be implemented. Provided we share an initial OTP, possibly via USB or some other physically secure method, surely we can include the next one in the messages that follow. [Edit: More specifically, if I were to take a pad of do...
wleightond
3

votes
2

answer
980

Views

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 IV must be unique for each Rijndael encryption. Is...
user774411
11

votes
6

answer
13.8k

Views

What is the performance difference of pki to symmetric encryption?

We are looking to do some heavy security requirements on our project, and we need to do a lot of encryption that is highly performant. I think that I know that PKI is much slower and more complex than symmetric encryption, but I can't find the numbers to back up my feelings.
stevemac
22

votes
4

answer
50k

Views

AES-256 encryption in PHP

I need a PHP function, AES256_encode($dataToEcrypt) to encrypt the $data into AES-256 and another one AES256_decode($encryptedData) do the opposite. Does anyone know what code should this functions have?
mariannnn
22

votes
2

answer
13.3k

Views

Symmetric Encryption (AES): Is saving the IV and Salt alongside the encrypted data safe and proper?

I am trying to make sense of how to handle and manage an initilization vector and salt (when applicable) when encrypting and decrypting data using a symmetric encryption algorithm, in this case AES. I have deduced from different SO threads and various other websites that neither the IV or salt need...
Caster Troy
2

votes
1

answer
43

Views

Separate data encryption

I store some sensitive data. Data is divded into parts and I want to have separate accees to each part. Let's assume that I have 1000 files. I want to encrypt each file by the same symetric encryption algorithm. I guess that breaking a key is easier when hacker has got 1000 cryptogram than he has o...
Mariusz
2

votes
1

answer
168

Views

Symmetric Encryption with GPGME

According to the documentation the gpgme_op_encrypt method of GPGME is able to perform symmetric encryption tasks: gpgme_op_encrypt (gpgme_ctx_t ctx, gpgme_key_t recp[], gpgme_encrypt_flags_t flags, gpgme_data_t plain, gpgme_data_t cipher) If recp is NULL, symmetric rather than public key encryption...
little_planet
1

votes
3

answer
101

Views

Downsides to Using the Same Value for Key and IV?

I am implementing some classes for .NET that (among other things) simplify encryption and decryption. My current algorithm creates an 8-byte salt, and uses that salt with the password to generate both the key and IV. I then store the salt, unencrypted, with my encrypted data. This is nice because th...
Jonathan Wood
22

votes
3

answer
55.2k

Views

Really simple encryption with C# and SymmetricAlgorithm

I'm looking for a very simple crypt / decrypt method. I will be using always the same static key. I'm aware of the risks of this approach. Currently I'm using the following code but it does not generate the same result after crypting and decripting the same string (there is some garbage in the middl...
Ignacio Soler Garcia
4

votes
1

answer
831

Views

How can I create a shared-secret voucher code system between 2 independent servers?

Given this workflow: Server A User authenticates. User purchases randomly generated unique voucher code using shared secret to use an application on on server B. Server B User authenticates. User inputs voucher code. Server B validates code is legitimate using shared secret Server B grants access to...
Andrew

View additional questions