aes

Incompatible AES implementations?

匿名 (未验证) 提交于 2019-12-03 01:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've compiled some AES implementation code from this site , it's supposed to perfrom a 128 bits key encryption. I tested the encryption/decryption programs which work OK together. However if I encrypt anything with the mentioned code and then try to decrypt it by openssl tool built-in in linux, I just can't get decrypt it, it even logs me the bad magic number error. Same, if I encrypt anything with openssl and try to decrypt with the code won't work. I tried with both cbc ecb. If they're both implementing AES, shouldn't it work same way? 回答1

AES 256 CBC encryption in Laravel and Decryption in android

匿名 (未验证) 提交于 2019-12-03 01:40:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So my problem is this: i have a password that i'm encrypting in Laravel 5.6 with AES-256-CBC and send it to an android device, problem is i can't find a way to decrypt it knowing that i found a way to extract the IV and the encrypted value and the key is available on the android device ! I'm successfully decrypting the value if i use AES-128-CBC using this code on the android device, but failing the AES-256-CBC cypher and i don't understand where the problem is ! The code : public static String decrypt(byte[] keyValue, String ivValue, String

AES 256 (instead of 128) with BouncyCastle

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I followed much of this post with the objective to implement aes 256 encryption in my software and it works just fine The key point here is that the whole implementation described in the above link uses the AESEngine class . Looking at the class code and javadoc reference , the AESEngine is a 128bit instead of a 256 bit block cipher Searching trough the code and docs i could not find the 192 or 256 bits implementations. Where are them? For completeness, this is the core of my actual ciphering class: private void init(String passphrase) { try

standard eval with ggplot2 without `aes_string()`

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'd like to pass a quoted string to a function that calls ggplot2. library(magrittr); library(ggplot2) g1 <- function( variable ) { ggplot(mtcars, aes_string("wt", variable, size="carb")) + geom_point() } g1("mpg") This works well, but the v3.1.0 documentation advocates quasiquotation and the NSE aes() . All these functions are soft-deprecated. Please use tidy evaluation idioms instead (see the quasiquotation section in aes() documentation). But the aes() examples use NSE ( ie , g1(mpg) instead of g1("mpg") ). Likewise, these SO solutions

AES CTR 256 Encryption Mode of operation on OpenSSL

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, const unsigned long length, const AES_KEY *key, unsigned char ivec[AES_BLOCK_SIZE], unsigned char ecount_buf[AES_BLOCK_SIZE], unsigned int *num); Hi Caf I really appreciate your quick answer it has been really useful, and defenetly the best example I have found on the web. I am trying to open a file with undetermined length, encrypt it and write another file with the ciphertext generated, then open the ciphered file and recover the plaintext. I need to use a file of a

ggplot2: how to add sample numbers to density plot?

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to generate a (grouped) density plot labelled with sample sizes. Sample data: set.seed(100) df <- data.frame(ab.class = c(rep("A", 200), rep("B", 200)), val = c(rnorm(200, 0, 1), rnorm(200, 1, 1))) The unlabelled density plot is generated and looks as follows: ggplot(df, aes(x = val, group = ab.class)) + geom_density(aes(fill = ab.class), alpha = 0.4) What I want to do is add text labels somewhere near the peak of each density, showing the number of samples in each group. However, I cannot find the right combination of options to

Converting VB6 AES Rijndael Block Cipher to C# by Phil Fresle

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am converting a classic asp application to C#, and would like to be able to decrypt strings in c# that were originally encrypted in classic asp. the classic asp code is here , and the c# code is here . The problem that i am facing is that the signatures of the Encrypt and Decrypt methods in asp vs C# are different. here is my asp code for decrypting, which wraps the decrypt code. Function AESDecrypt(sCypher) if sCypher <> "" then Dim bytIn() Dim bytOut Dim bytPassword() Dim lCount Dim lLength Dim sTemp Dim sPassword sPassword = "My

How to config local Jetty ssl to avoid weak phermeral DH key error?

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm using keytool to generate a keystore to config a local development jetty to run ssl keytool . exe - keystore jetty . keystore - alias jetty - genkey - keyalg RSA - sigalg SHA256withRSA Jetty config: <Call name = "addConnector" > <Arg> <New class = "org.eclipse.jetty.server.ssl.SslSelectChannelConnector" > <Arg> <New class = "org.eclipse.jetty.http.ssl.SslContextFactory" > <Set name = "keyStore" > jetty/jetty.keystore </Set> <Set name = "keyStorePassword" > jetty6 </Set> <Set name = "keyManagerPassword" > jetty6 </Set> <Set name

IllegalBlockSizeException when trying to encrypt and decrypt a string with AES

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a hardcoded key with which I want to encrypt a string before storing it in SharedPreferences . This is the code I have so far: public class TokenEncryptor { private final static String TOKEN_KEY = "91a29fa7w46d8x41"; public static String encrypt(String plain) { try { Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); AlgorithmParameterSpec ivSpec = new IvParameterSpec(new byte[16]); SecretKeySpec newKey = new SecretKeySpec(TOKEN_KEY.getBytes(), "AES"); cipher.init(Cipher.ENCRYPT_MODE, newKey, ivSpec); return new String(cipher

256bit AES/CBC/PKCS5Padding with Bouncy Castle

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am having trouble mapping the following JDK JCE encryption code to Bouncy Castles Light-weight API: public String dec(String password, String salt, String encString) throws Throwable { // AES algorithm with CBC cipher and PKCS5 padding Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding", "BC"); // Construct AES key from salt and 50 iterations PBEKeySpec pbeEKeySpec = new PBEKeySpec(password.toCharArray(), toByte(salt), 50, 256); SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithSHA256And256BitAES-CBC-BC");