Newest 'encryption-symmetric' Questions

Q&A for professional and enthusiast programmers

Openssl AES 256 CBC Java Decrypt File with salt

I have been trying for several days to decrypt in java a message encrypted with openssl. The message was encrypted with the following command: openssl enc -e -aes-256-cbc -kfile $ file.key -in toto -...

DES encryption using native java classes [duplicate]

Trying to create java class which will encrypt and decrypt as like C# code in below. Below is the code for C#, I need to convert it to Java. Can someone help me how to do it? I've been doing this ...

misunderstanding of TLS functionality on Mosquitto's broker

i configured TLS on the mosquitto's broker as described , if i understand the real functionality of TLS : it use both asymmetric and symmetric crypto ,asymmetric crypto for changing the key between ...

most popular javascript encryption library

I know that client-side encryption would raise a lot of criticism, like I've seen on other threads. Anyway, I'd like to implement such a feature on a web based application I'm developing in order to ...

AES/CBC/NoPadding and IllegalBlockSizeException - Custom padding handling

UPDATE: I removed another issue in my code to make the question more precise. I need to encrypt a String with variable length with AES/CBC/NoPadding but I'm getting an IllegalBlockSizeException. I ...

max plaintext size for Android Keystore symmetric encryption?

I'd like to use the Android Keystore to do symmetric AES encryption of large (multi MB) data files. I've written demo code that will encrypt/decrypt multi-KB files with the Keystore, but when the ...

How To Code A BlackBox in Python Using Homomorphic or…?

I need a "blackbox" coded in Python... ...Meaning, code that receives unencrypted inputs, runs those inputs through an encrypted algorithm, then sends out unencrypted outputs. I just ran across this:...

Getting BadPaddingException while doing a Sqoop import with encrypted password file

I encrypt file with openssl then put it on HDFS, I used AES/ECB, 128 bits and salt option, and with some research I find out openssl uses PKCS5 padding as default which are all defaults in ...

C# to Java DES encryption

Trying to create java class which will encrypt and decrypt as like C# code in below. Below is my code for C#, I need to convert it to Java. Can someone help me how to do it? I've been doing this for ...

Hybrid cryptosystem implementation in .net. Error Specified key is not a valid size for this algorithm

I am trying to implement hybrid cryptosystem as mentioned in https://en.wikipedia.org/wiki/Hybrid_cryptosystem At the moment I have implemented following algorithm private void button1_Click(object ...

Decrypting byte array with SymmetricAlgorithm and CryptoStream

My encrypting and decrypting methods: private static SymmetricAlgorithm GetAlgorithm(string password) { using (Rijndael algorithm = Rijndael.Create()) { using (Rfc2898DeriveBytes rdb =...

Encryption of Database Id

I was working on developing a RESTful service where the Id of a particular table in the database needs to be returned to the client for future access to the particular entry in the database. I was ...

How to get decrypted key from org.jose4j.jwe.JsonWebEncryption object?

We set the JsonWebEncryption values at the sender's end. 'rsk' is the 32 byte Random Symmetric Key that is used to encrypt the 'message'. In turn 'rsk' itself is encrypted by public key. byte[...

ASKE(Alpha Secure Key Establishment) in Zigbee

I am working on zigbee security. For key establishment, some approaches are given in zigbee. Some of them are ASKE(Alpha Secure Key Establishment), ASAC(Alpha Secure Access Control), SKKE(Symmetric ...

symmetric encryption in c# resembles JAVA

private static byte[] encryptData(ByteArrayOutputStream data, byte[] symmetricKey) throws EncryptionException { try { SecretKey secKey = new SecretKeySpec(symmetricKey, "AES"); ...

encrypt a Hash with Symmetric Encryption gem

i want to encrypt a hash that is being allowed on a Mongodb i use Mongoid, symmetric-encryption and mongoid-encrypted-fields gems cause i read that have support for Mongoid and ActiveRecord cause i ...

SQL Encryption - Why does the Master Key automatically refer to the Certificate?

I just recently came in touch with MS SQL Encryption, where I used a Master Key, a Certificate and a Symmetric Key. When I tried to DEcrypt it, I've had quite the hard time getting through the key ...

Encrypting data which we want to correlate later

I want to encrypt some sensitive information (no more than 30 bytes) with a private key so that it cannot be reversed by random person. But it should be correlatable E.g if I have for example string “...

javax.crypto.Cipher equivalent code in Nodejs Crypto Javascript

I'm trying to convert below java code into nodejs. public static String encrypt(String accessToken) throws Exception { Cipher cipher = Cipher.getInstance("AES"); String merchantKey = "...

Java - Vignere Cipher doing something wrong

I attempted writing an method which takes an array of characters from the main and then returns a character array of the encrypted/decrypted characters. When I apply the method twice to a given char ...

“unknown: this object doesn't support multiple channels” during encryption

I am getting "unknown: this object doesn't support multiple channels" exception during file encryption. I am able to generate session key but it can not be used to encrypt file. The following is my ...

nodejs aes256 encrypt is different from online aes256 encryption tool

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 ...

CryptEncrypt function encrypting data which corrupts on writing into a file.

For encryption, I use "CryptEncrypt" and for decryption I use the "CryptDecrypt". MSDN link: https://msdn.microsoft.com/en-us/library/windows/desktop/aa379924(v=vs.85).aspx When I encrypt the ...

the result of ECB Encryption is maybe different. it is same as the result of CBC

public class Symmetric1 { /** * @param args the command line arguments */ public static void main(String[] args) throws Exception{ // TODO code application logic here ...

How to send data in secure way between client and server using only Symmetric cryptography

I'd take the following steps to send/received data between client and server. But I'm not sure if all the steps are secure enough and impossible to intercept. Please can you let me know how to patch ...

Indentify encrypted string get from iphone tweak

I am trying to decrypt a string which i got from iphone tweak. But i have some problem when trying to decrypt it with RNCryptor ( i think the client use this to encrypt the string) but when i try to ...

Secure connection between client and server application

I know there are many question regarding this topic, but I swear I could not find the answer that best fits my problem. It's a conceptual issue. I have a client and a server application and they must ...

Setting AES cipher mode for ASP.NET MachineKey from web.config

I try using ASP.NET FormAuthentication for my website authentication. I added machineKey element in my web.config so that I can choose what validation and decryption algorithms to use for my ...

Securing symmetric key

In my project (windows desktop application) I use symmetric key in order to encrypt/decrypt some configurations that need to be protected. The key is hardcoded in my code (C++). What are the risks ...

Hybrid cryptography. Length of the data to decrypt is invalid

I am getting above mentioned error during a hybrid cryptography implementation. as per https://en.wikipedia.org/wiki/Hybrid_cryptosystem I am just stucked at the last step My code is private ...

Encryption Decryption AES/ECB/NoPadding

is there any method de encrypt/decrypt a string in iOS following this algorithm ? all i know that in java this class : javax.crypto.Cipher is used for this purpose

How to encrypt nvarchar column in oracle?

I have a table containing nvarchar datatype columns (contains text in different languages). I want to encrypt data before inserting into table and decrypt the same while fetching records. Please ...

What is the proper way to handle key derivation on Android with libsodium?

I am trying to use libsodium for symmetric encryption on Android. In order to get libsodium on android, I am using this binding library. I am struggling to find the proper way to derive a key from a (...

Crypto in Linux

I understand that in Linux kernel there are basically, 2 types of crypto options: cryptodev (/dev/crypto) AF_ALG But in documentation, both methods are mentioned as HW encryption , i.e. methods ...

EVP_DecryptFinal_ex Error - Large arrays

I'm trying to decript some large strings encrypted with AES CBC 256 in OpenSSL, but when i call the method EVP_DecryptFinal_ex with large arrays, more than 3000 positions, the method returns 0. If i ...

Mifare Desfire symmetric authentication with master key on android

I wanted to use the Mifare Desfire chip for product authentication purposes, where the chip would be embedded into products. As such, I am looking for a NFC solution that makes it virtually impossible(...

How to encode Permutation of Substitution

I want to substitute from cypher text to plain text. But there can be n! possibilities where n is the number of characters for example cypher: [ a, b, c, d ] plain : [ x, y, z, m ] Let's say that ...

Java 1.8 symmetric DESede encryption and decryption [duplicate]

I come with an issue related to JCE. Context SDK: JDK 1.8 OS: Ubuntu 14 I have been asked to implement a component for decrypt java.lang.String. The encrypted string is part of webservice response ...

C# AesManaged to PCLCrypto

I tried to decrypt string that is encrypted using .NET AesManaged. Here is the .NET decrypt code: public static string Decrypt(byte[] data, string pwd, byte[] salt) { using (Aes aes = new ...

s-box for symmetric and asymmetric cryptography

I am researching about cryptography and found out that there are s-box in symmetric cryptography. However, I do not see common-used asymmetric cryptography use s-box. Is there any famous or popular ...

PHP & Mysql -Queries using symmetric key decryption

I am attempting to use PHP to execute an SQL query which uses symmetric key decryption. However I am unable to get any results. My PHP code looks like this: $sql = "OPEN SYMMETRIC KEY ServerKey ...

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. ...

Symmetric encryption - is it insecure to use one symmetric key to encrypt another or do I need to use asymmetric keys [closed]

I'm trying to add a hybrid encryption scheme to my PHP application, and by "hybrid" I mean that each record in the database is encrypted by its own unique symmetric key and each symmetric key is ...

A more secure symmetric encryption key vs. assymetric key

What are the advantages of having a symmetric encryption algorithm with a lower probabilty of key retrieval than the asymmetric encryption used for transferal of symmetric key? I can see how it ...

Android Encryption using predefined symmetric key

Im currently creating an Android application that performs decryption on a certain string. The scenario of the app is: From a server (PHP), generate a symmetric key Insert manually the same secret ...

AES 256 program not working [closed]

So I have been attempting to implement AES-256 in C. After lots of reading around and following the wikipedia page to implement it, I managed to code it. Only when I tested it, it seemed to give the ...

Key export laws across different countries

I have this problem with my key managers and key management best practices. Can I encrypt data in one country while keeping/storing the keys in a different one. Are there any restrictions/regulations ...

S-box in AES CCM 128 bit

I am working on encryption & decryption of data using AES-CCM. While studying AES, I came across a word called S-Box. What is S-Box, and the relationship with AES? How can it be calculated? Is ...

How to generate a AES-256 CBC key/iv that can be shared as a string?

I am trying to make AES-256 CBC encryption work in PHP, Ruby (using SymmetricEncryption) and Javascript (using CryptoJS). As for the first 2: <?php openssl_encrypt( 'Hello!', 'aes-256-cbc', '...
Translating... 0%