aes

Encrypt text to AES/CBC/PKCS7Padding

吃可爱长大的小学妹 提交于 2019-12-18 04:12:16
问题 I am developing a web application to encrypt some texts with java 6. The encrypted that I have to do is a AES (Rijndael) in CBC mode with PKCS7 padding and a 128-bit key. I saw an article that explains how to encrypt in the same way I have to do, but with PKCS5 padding. The link of the article is here: https://bit502.wordpress.com/2014/06/27/codigo-java-encriptar-y-desencriptar-texto-usando-el-algoritmo-aes-con-cifrado-por-bloques-cbc-de-128-bits/ I change private final static String cI =

Source and importance of nonce / IV for protocol using AES-GCM

不打扰是莪最后的温柔 提交于 2019-12-18 04:01:53
问题 I am making a protocol that uses packets (i.e., not a stream) encrypted with AES. I've decided on using GCM (based off CTR) because it provides integrated authentication and is part of the NSA's Suite B. The AES keys are negotiated using ECDH, where the public keys are signed by trusted contacts as a part of a web-of-trust using something like ECDSA. I believe that I need a 128-bit nonce / initialization vector for GCM because even though I'm using a 256 bit key for AES, it's always a 128 bit

Implement OpenSSL AES Encryption in Python

房东的猫 提交于 2019-12-18 03:46:28
问题 I'm trying to implement the following in Python: openssl enc -e -aes-256-cbc -base64 -k "Secret Passphrase" -in plaintext.txt -out ciphertext.txt openssl enc -d -aes-256-cbc -base64 -k "Secret Passphrase" -in ciphertext.txt -out verification.txt I've tried several different modules, PyCrypto, M2Crypto, etc but can't seem to get the correct combination of changing the password to the right size key and encoding everything correctly. I've found https://github.com/nvie/SimpleAES but that

How to get compatibility between C# and SQL2k8 AES Encryption?

有些话、适合烂在心里 提交于 2019-12-18 02:50:33
问题 I have an AES encryption being made on two columns: one of these columns is stored at a SQL Server 2000 database; the other is stored at a SQL Server 2008 database. As the first column's database (2000) doesn't have native functionality for encryption / decryption, we've decided to do the cryptography logic at application level, with .NET classes, for both. But as the second column's database (2008) allow this kind of functionality, we'd like to make the data migration using the database

How to get compatibility between C# and SQL2k8 AES Encryption?

时间秒杀一切 提交于 2019-12-18 02:50:10
问题 I have an AES encryption being made on two columns: one of these columns is stored at a SQL Server 2000 database; the other is stored at a SQL Server 2008 database. As the first column's database (2000) doesn't have native functionality for encryption / decryption, we've decided to do the cryptography logic at application level, with .NET classes, for both. But as the second column's database (2008) allow this kind of functionality, we'd like to make the data migration using the database

Alternatives for DatatypeConverter in Android

匆匆过客 提交于 2019-12-18 01:03:06
问题 I trying implement algorithm AES 128 in Android but it doesn't work, the problem is import javax.xml.bind.DatatypeConverter; DatatypeConverter.parseHexBinary(key) and DatatypeConverter.printBase64Binary(finalData) Does an alternative exist? My method: private static final String ALGORIT = "AES"; public static String encryptHackro(String plaintext, String key) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException,

Encrypting and Decrypting with python and nodejs

三世轮回 提交于 2019-12-17 23:22:13
问题 I'm trying to encrypt some content in Python and decrypt it in a nodejs application. I'm struggling to get the two AES implementations to work together though. Here is where I am at. In node: var crypto = require('crypto'); var password = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'; var input = 'hello world'; var encrypt = function (input, password, callback) { var m = crypto.createHash('md5'); m.update(password) var key = m.digest('hex'); m = crypto.createHash('md5'); m.update(password + key) var iv

Encryption using AES-128 in Android and IPhone (Different result)

痴心易碎 提交于 2019-12-17 22:24:20
问题 I am trying to encrypt some text using the AES algorithm on both the Android and IPhone platforms. My problem is, even using the same encryption/decryption algorithm (AES-128) and same fixed variables (key, IV, mode), I get different result on both platforms. I am including code samples from both platforms, that I am using to test the encryption/decryption. I would appreciate some help in determining what I am doing wrong. Key: “123456789abcdefg” IV: “1111111111111111” Plain Text: “HelloThere

How to fix Invalid AES key length?

元气小坏坏 提交于 2019-12-17 21:53:17
问题 I am working on a text encryption and decryption project (following Struts 2) Whenever I enter the password and the plain text I get a Invalid AES Key Length error. The Service Class package com.anoncrypt.services; import java.security.Key; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; import sun.misc.BASE64Decoder; import sun.misc.BASE64Encoder; public class SymAES { private static final String ALGORITHM = "AES"; private static byte[] keyValue= new byte[] { 'T', 'h', 'i

Simple AES encryption decryption with openssl library in C

杀马特。学长 韩版系。学妹 提交于 2019-12-17 19:45:18
问题 I want to encrypt a struct containing few String and then decrypt it. I tried following code. The original code is found from the web and it was working perfectly. I change the input of it to a struct. following is the code. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <openssl/aes.h> #include <openssl/rand.h> typedef struct ticket { /* test field */ int ticketId; char username[20]; char date[20]; } USR_TICKET; // a simple hex-print routine. could be