encryption-symmetric

Data encryption in application cluster

佐手、 提交于 2019-12-12 14:33:31
问题 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 of generating a common key, propagating the key across all clones in an isolated JCEKS keystore. Settled on AES (256) for the cipher and key length. Question I have is how safe is this approach? My fear is we create all of this and encrypt the data,

BadPadding exception when trying to decrypt AES based encrypted text

非 Y 不嫁゛ 提交于 2019-12-12 12:20:18
问题 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: U2FsdGVkX194TyUFrb4gOn86XYaKjKP98YdOlQDJz+t/76mvVmNKl+NyKKUnYwYH To Decrypt: openssl aes-256-cbc -a -d -in avengers.enc Now I want to decrypt this encrypted file avengers.enc using java code i.e., I just store this file content and password (in this case test) to decrypt it. My

mcrypt doesn't work in PHP 5.6 on windows/IIS

风格不统一 提交于 2019-12-12 10:37:32
问题 I have been making heavy use of mcrypt in my php app for years, both on win/IIS and on linux. Although I'm running PHP 5.4.28 on my linux server, I just upgraded to PHP 5.6.11 on my windows 8.1 IIS box. And mcrypt no longer works. It doesn't throw any errors that I can see; it just doesn't work. Here is my encryption function: function Encrypt($text){ global $salt; if($text != "") return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $salt, $text, MCRYPT_MODE_ECB, mcrypt_create_iv

nodejs aes256 encrypt is different from online aes256 encryption tool

♀尐吖头ヾ 提交于 2019-12-12 05:48:15
问题 I encrypted word HelloWorld using nodejs-aes256 https://www.npmjs.com/package/nodejs-aes256 with key apple the output was 1ivBqj+nVPcHvZjQlx7Di0SoxV49bNpWtog= then I encrypted same word with same key using online tool http://aesencryption.net/ the output was LIxrc1buLeLLr9nJxtPhjHSYFVaceqsXiFamWiVWzYI= Whey are they different? 回答1: First, "apple" can't be a key for AES-256. It's not long enough. An AES-256 key has to be exactly 256 bits (32 bytes). "apple" is, in the likely ways of encoding

AES key finding from encrypted and plaintext data

本小妞迷上赌 提交于 2019-12-12 04:39:28
问题 If I have a plaintext message M along with its encrypted equivalent E, and I know that it has been encrypted with a 256-bit AES key, is there a way to work out the key? Are there ways to do it, if M is long enough? 回答1: In theory yes. In reality no. You'll need either to have software running on the same machine that is performing the encryption and attack the system through cache analysis: "In April 2005, D.J. Bernstein announced a cache-timing attack that he used to break a custom server

Generating a symmetric key in php

走远了吗. 提交于 2019-12-11 22:07:28
问题 Im trying to generate a symmetric key, which i can use to both encrypt and decrypt a message with the same key, in php. I've made my way through the php documentation below but can only find public/private key generations: http://www.php.net/manual/en/function.openssl-pkey-new.php Any ideas on how i can use these key generating functions for making a symmetric key? Thanks, Joe 回答1: A symetric key is basically a random set of bytes. If you want to use the openssl extension use openssl_random

Is the same key derived providing the same salt and password using Rfc2898DeriveBytes

夙愿已清 提交于 2019-12-11 16:49:20
问题 I read this tutorial about encryption in .NET it uses Rfc2898DeriveBytes to create a random key to be used by symmetric algorithm . but it doesn't save the key . and later in decryption method it supplies the same password and salt and decrypts the text . does it mean supplying the same salt and password to Rfc2898DeriveBytes could derived the same key ? no need to save the key and just save salt and password ? 回答1: Yes, that is correct. Identical inputs to Rfc2898DeriveBytes provide

Encryption in c lang. and decryption in c#

∥☆過路亽.° 提交于 2019-12-11 09:31:32
问题 I have used Rijndael (Encryption Algorithm) in my server side code, which is in C language. But my client is written in C# and C# provide its own Rijndael class to encrypt and decrypt. At client side I am using the same password for key generation but the client application is unable to decrypt it. I want to encrypt a file in C and decrypt that file in .NET (C#). Server Code : http://www.efgh.com/software/rijndael.txt Client Code : public static void Encrypt() { string password = @

Where does SSL symmetric key is stored?

旧城冷巷雨未停 提交于 2019-12-11 04:37:11
问题 This is what I understand for 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 algorithm during the SSL session. My questions: After session key is generated, where does it stored in server side? Is it stored in web server memory? And is it stored as encrypted? 回答1: This is what I understand for SSL communication. The browser gets

How do encryption algorithms know if they have the right key

人走茶凉 提交于 2019-12-11 03:38:06
问题 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(plainText, key, iv); // now I have some cipher text that is not readable to anyone if they do not have the key and iv vector. if someone wants to decrypt that message then they will have to do something