aes

Format geom_text label doesn't work when using aes_string

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using the dot function to format text labels in a plot created with ggplot2 . This works fine when using aes , but doesn't work like expected when using aes_string . Is there a workaround to make it work with aes_string ? require(ggplot2) # Define the format function dot <- function(x, ...) { format(x, ..., big.mark = ".", scientific = FALSE, trim = TRUE) } # Create dummy data df <- data.frame(cbind(levels(iris$Species),c(10000000000,200000,30000))) df$X2 <- as.numeric(as.character(df$X2)) # Works with aes ggplot(iris) + geom_bar(aes

Plotting rectangles in ggplot2 - Invalid input: time_trans works with objects of class POSIXct only

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have this data df <- structure(list(IndID = structure(c(16L, 15L, 14L, 13L, 12L, 11L, 10L, 9L, 8L, 7L, 6L, 5L, 4L, 3L, 2L, 1L), .Label = c("16", "15", "14", "13", "12", "11", "10", "9", "8", "7", "6", "5", "4", "3", "2", "1"), class = "factor"), StartDate = structure(c(1313042400, 1312956000, 1313560800, 1363672800, 1374040800, 1374040800, 1374040800, 1374040800, 1374040800, 1374040800, 1374040800, 1365832800, 1365919200, 1366178400, 1395727200, 1395813600), class = c("POSIXct", "POSIXt" )), EndDate = structure(c(1377928800, 1378015200,

AES to return Alphanumeric

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an aes encryption code, i want to make it only return alphanumerical characters like {0123456789ABCDEFGHIJKLMNOPQRSTWUVYZ} But however i could not figure out how to do that. I have almost no idea about encryption, could not figure out where to fix. I would really apreciate your feedback. Regards... public class clsCrypto { private string _KEY = string.Empty; protected internal string KEY { get { return _KEY; } set { if (!string.IsNullOrEmpty(value)) { _KEY = value; } } } private string _IV = string.Empty; protected internal string IV

Decryption error on Android 4.4

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have algorithm of encryption\ decryption files: private static byte[] encrypt(byte[] raw, byte[] clear) throws Exception { SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES"); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, skeySpec); byte[] encrypted = cipher.doFinal(clear); return encrypted; } private static byte[] getRawKey(byte[] seed) throws Exception { KeyGenerator kgen = KeyGenerator.getInstance("AES"); SecureRandom sr = new SecureRandom(); sr.setSeed(seed); kgen.init(sr); // 192 and

TLS v1.2 ciphers to use in PHP NUSOAP SoapClient

匿名 (未验证) 提交于 2019-12-03 08:41:19
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to connect to a server that only supports TLS 1.2. What possible ciphers can I specify to stream context in the PHP NUSOAP SoapClient creation? <?php $objSoapClient = new SoapClient( "https://example.com/?wsdl", array( "encoding"=>"ISO-8859-1", "stream_context"=>stream_context_create( array( "ssl"=>array("ciphers"=>"<????>") ) ) ) ); ?> 回答1: TLS v1.2 is described in RFC5246 , you can read it here . List of ciphers you can find in openssl wiki , use the second line without trailing 256 . You can manually get a list of ciphers used by

javax.crypto.IllegalBlockSizeException: last block incomplete in decryption exception

时光怂恿深爱的人放手 提交于 2019-12-03 08:41:05
I am trying to decrypt a string in android. I keep getting the following exception: 08-21 03:56:56.700: W/System.err(4208): javax.crypto.IllegalBlockSizeException: last block incomplete in decryption 08-21 03:56:56.700: W/System.err(4208): at com.android.org.bouncycastle.jce.provider.JCEBlockCipher.engineDoFinal(JCEBlockCipher.java:697) 08-21 03:56:56.700: W/System.err(4208): at javax.crypto.Cipher.doFinal(Cipher.java:1106) 08-21 03:56:56.700: W/System.err(4208): at com.dharani.android.legalplex.BusinessLayer.BLCommonOperations.decrypt(BLCommonOperations.java:284) 08-21 03:56:56.700: W/System

How to Encrypt/Decrypt text in a file in Java

为君一笑 提交于 2019-12-03 08:38:59
I have a problem with my code, when I encrypt data, for example, in this case, the simmetric key I encrypted with the receiver's public key, then saved to a text file, when I read that text file and try to decrypt it, using the receiver's private key, I get a different key, therefore I cannot use it to decrypt the encrypted message. Sender's code: import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.security.KeyStore; import java.security.MessageDigest; import java.security.PrivateKey; import java.security.PublicKey;

is AES key random?

南笙酒味 提交于 2019-12-03 08:34:32
AES key may be generate by this code KeyGenerator kgen = KeyGenerator.getInstance("AES"); kgen.init(128); but If I have a "very reliable" method of generating random numbers can I use it in such a way SecureRandom rnd = new SecureRandom(); byte[] key = new byte[16]; rnd.nextBytes(key); is key obtained by this method reliable ? or it ONLY must generated by some SPECIAL algorithm The AES key can be any 128 bits. It should be be practically unguessable, whatever the method of creating it. For Example: SecureRandom sr = new SecureRandom() key = new byte[16]; iv = new byte[16]; sr.nextBytes(key);

PHP - Class declarations may not be nested

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a project in cakephp, when I call a vendor for decrypting a string using AES, I get the error: Fatal error: Class declarations may not be nested in /var/www/html/myproject/cake/libs/log/file_log.php on line 30 This is the code in my controller: App::import('vendor', 'aes', array('file' => 'AES/AES.php')); $aes = new AesCtr(); $decrypted = $aes->decrypt($encrypted, "mykey", 128); And this is part of the vendor (one single file called AES.php): class Aes { //....Methods } class AesCtr extends Aes { public static function decrypt(

Android encryption/decryption issue (AES)

蹲街弑〆低调 提交于 2019-12-03 08:29:37
I need a little help here.So basically I have to make a test of AES encryption/decryption of an image in Android.I'm new in android programming and that's why a friend of mine give me an example of how to do it, but the problem is that when I run the sample it crashes after like 20-30 seconds and I'm not really sure what's happening.So can anyone please look at the code and tell me where is the problem.The sample code needs to do this : Encrypt and Decrypt the same image and show me a log with info, how long it takes to encrypt and decrypt the image.Thanks anyway! Code : package com.cryptooo