encryption

Chef Decryption of Data Bags and Retrieval of Key

[亡魂溺海] 提交于 2020-01-15 16:39:21
问题 I am using an encrypted data bag to encrypt an ssh key and decrypted it via Chef. The data bag had an id of pwind_ssh_rsa_pub_cred, but what I really want is the unencrypted data for the ssh key. I want to then take the key and append it to a file, but the code that I have currently is running into some issues. With static values, the below code works. Additionally, I am a big confused as to what the type is of "decrypted_ssh". ruby_block "obtainCredentials" do block do hadoop_key = Chef:

c# Triple DES encryption with two keys

£可爱£侵袭症+ 提交于 2020-01-15 12:12:35
问题 I have to encrypt a hex string with two keys. My code for this looks like that: public byte[] TripleDes(byte[] inputBuffer, byte[] key) { byte[] result; using (TripleDESCryptoServiceProvider des = new TripleDESCryptoServiceProvider()) using (MemoryStream stream = new MemoryStream()) using (CryptoStream cryptoStream = new CryptoStream(stream, des.CreateEncryptor(), CryptoStreamMode.Write)) { des.Key = key; // des.KeySize = 128; <- wrong, overrides the values of the key des.Mode = CipherMode

RC4 decryption with key in Python

心已入冬 提交于 2020-01-15 11:25:16
问题 I pulled this code from here for asp http://bytes.com/topic/access/insights/906671-rc4-encryption-algorithm-vba-vbscript, which i then run thru base64. I am wonder if anyone can help me figure out how to write the decryption piece but in Python. As the decryption will happen on my Python Server Page. Found this http://www.id-snippet.com/20801/python-rc4-cipher/, but it doesn't decrypt the RC4 asp from the first link. -Jim %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ASP page 'Base64

RC4 decryption with key in Python

a 夏天 提交于 2020-01-15 11:23:35
问题 I pulled this code from here for asp http://bytes.com/topic/access/insights/906671-rc4-encryption-algorithm-vba-vbscript, which i then run thru base64. I am wonder if anyone can help me figure out how to write the decryption piece but in Python. As the decryption will happen on my Python Server Page. Found this http://www.id-snippet.com/20801/python-rc4-cipher/, but it doesn't decrypt the RC4 asp from the first link. -Jim %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ASP page 'Base64

RSA decrypt with Java

别等时光非礼了梦想. 提交于 2020-01-15 10:18:06
问题 I am trying to decrypt a string with RSA. It was encrypted in C# on the iPhone and I have the private key. This seems like a silly problem, but all of the examples I have seen show generating the private key. I have the private key (it is a byte[] of hex). It using PKCS#1 padding. The part I cannot figure out how to do is create a java.security.Key object with the private key I already have. Do I need to have them give me the private key in 2 parts...modulus and exponent? Thanks in advance.

How do I move a AutoGenerate,IsolateApps machine key system onto a load balanced server?

痴心易碎 提交于 2020-01-15 09:22:50
问题 I just found, web.config with below settings in all the environments including prod. <machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="SHA1" decryption="Auto" /> Now, application is going to start using with load balancing. Would it create problem as its not using static machine keys ? If I change this key now to static validaitnKey and static decrptionKey then it creates another problem for already protected keys unable to decrypt.

how to encrypt data with AES 256 ECB PKCS5Padding in ruby

喜欢而已 提交于 2020-01-15 07:48:47
问题 I want encrypt data with AES 256bit ECB mode using PKCS5padding My ruby method is as follows, how to use PKCS5Padding here def encrypt(raw_data,key) cipher = OpenSSL::Cipher::AES.new(256, :ECB) cipher.encrypt cipher.key = key encrypted_data = cipher.update(raw_data) + cipher.final end here key is OpenSSL::PKey::RSA type, throwing no implicit conversion of OpenSSL::PKey::RSA into String exception 回答1: I think your key is in the wrong format. You're trying to pass an RSA key, when the key

Trying to get AES encryption of a string in node.js to match encrypted value in .net

旧巷老猫 提交于 2020-01-15 07:30:41
问题 I'm trying to encrypt a value in node.js that I can decrypt in .net. I've been given the code that they use on the .net side of things for encrypting a value and i'm trying to achieve the same encrypted value in my node.js script. I'm definitely not an encryption buff so please help me figure out where i'm going wrong. My node.js encrypted value is not matching that of the .net encrypted value, and my node.js encrypted value is actually not returning the same value every time I run the script

Trying to encrypt video frames with RSA; getting garbage instead of original data after decrypting

一曲冷凌霜 提交于 2020-01-15 05:40:08
问题 I am writing a script to encrypt and decrypt video using RSA algo in python. Now I have extracted the frames from the video and encrypt each image individually and then combining the images to create a video. Then I am reading the frames of the encrypted video again and when I am applying the decryption key I am not getting back the original image. But when I am applying the same key on any image with which the video is made I am getting back the original image. let us say we have image1

PKCS#5 padding for AES encryption in C/C++

被刻印的时光 ゝ 提交于 2020-01-15 05:30:11
问题 I did AES/ECB/PKCS5Padding encryption in JAVA . Now I am looking for equivalent method in C/C++ . I did manage to encrypt in C using the following code : const unsigned char *key = (unsigned char *)"A2XTXFEQFOPZFAKXFOPZFAK5"; unsigned char input[] = {"Hello World"}; int iLen = strlen((char*)input); int len = 0; if(iLen % 16 == 0){ len = iLen; } else{ len = (iLen/16)*16 + 16; } unsigned char output[len]; //next 16bit AES_KEY enc_key; AES_set_encrypt_key(key, strlen((char*)key)*8, &enc_key);