aes

Why is the ciphertext 32 bytes long when encrypting 16 bytes with AES?

怎甘沉沦 提交于 2019-12-03 19:09:29
问题 I use encryption AES algorithm, when i encrypt 16 byte(one block) the result is 32 byte. Is this ok? My source code that i used is: package net.sf.andhsli.hotspotlogin; import java.security.SecureRandom; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; /** * Usage: * <pre> * String crypto = SimpleCrypto.encrypt(masterpassword, cleartext) * ... * String cleartext = SimpleCrypto.decrypt(masterpassword, crypto) *

AES256 NSString Encryption in iOS

孤街醉人 提交于 2019-12-03 17:55:32
问题 My app encrypts and decrypts (or it should) an NSString (the text to be encrypted / decrypted) with another NSString (the keyword) using aes 256-Bit Encryption. When I run my project and run the encrypt method, nothing gets encrypted the textfield just clears itself. Here is the code I have: -(void)EncryptText { //Declare Keyword and Text NSString *plainText = DataBox.text; NSString *keyword = Keyword.text; //Convert NSString to NSData NSData *plainData = [plainText dataUsingEncoding

Objective-c AES encryption doesn't look like java AES encryption

一笑奈何 提交于 2019-12-03 17:44:35
Well im trying to encrypt an string in objective c extending NSData with this method: @implementation NSData (AES128) (NSData *)AES128Encrypt { char keyPtr[kCCKeySizeAES128] = {'\xe1','\xaa','\x9c','\x61','\x46','\x74','\x44','\x56','\xf0','\xe5','\x47','\x46','\x86','\xdc','\x95','\x77'}; NSUInteger dataLength = [self length]; size_t bufferSize = dataLength + kCCBlockSizeAES128; void *buffer = malloc(bufferSize); size_t numBytesEncrypted = 0; CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt,kCCAlgorithmAES128,kCCOptionPKCS7Padding,keyPtr,kCCKeySizeAES128,NULL /* initialization vector

Java 7 support of AES-GCM in SSL/TLS?

杀马特。学长 韩版系。学妹 提交于 2019-12-03 17:17:15
问题 According to Java 7 documentation as well as third party vendors, it appears Java 7 should support AES-GCM suites: ibm java 7 java 7 ssl doc I was hitting some errors in negotiation between client and server unable to negotiate a cipher due to restricting it to only the AES-GCM ciphers. After investigation I found that it appears that the cipher suites are not supported on client nor server (tomcat instance). Ran some sample code on client to get the output: // Create an SSLContext that uses

AES Decryption has different behavior in iOS 7 than iOS 8/9

我是研究僧i 提交于 2019-12-03 17:12:59
The following method returns different results when run on iOS 7 than it does on iOS 8/9. + (NSData *)decryptData:(NSData *)data key:(NSData *)key iv:(NSData *)iv; { NSData *result = nil; // setup key unsigned char cKey[FBENCRYPT_KEY_SIZE]; bzero(cKey, sizeof(cKey)); [key getBytes:cKey length:FBENCRYPT_KEY_SIZE]; // setup iv char cIv[FBENCRYPT_BLOCK_SIZE]; bzero(cIv, FBENCRYPT_BLOCK_SIZE); if (iv) { [iv getBytes:cIv length:FBENCRYPT_BLOCK_SIZE]; } // setup output buffer size_t bufferSize = [data length] + FBENCRYPT_BLOCK_SIZE; void *buffer = malloc(bufferSize); // do decrypt size_t

Speed difference between AES/CBC encryption and decryption?

拟墨画扇 提交于 2019-12-03 16:31:32
I am wondering, theoretically, how much slower would AES/CBC decryption be compared to AES/CBC encryption with the following conditions: Encryption key of 32 bytes (256 bits); A blocksize of 16 bytes (128 bits). The reason that I ask is that I want to know if the decryption speed of an implementation that I have is not abnormally slow. I have done some tests on random memory blocks of different sizes. The results are as follows: 64B: 64KB: 10MB – 520MB: All data was stored on the internal memory of my system. The application generates the data to encrypt by itself. Virtual memory is disabled

Does net-snmp support AES-192 and AES-256 encryption?

放肆的年华 提交于 2019-12-03 16:29:10
The network device has been configured with snmpv3 users which uses AES192 as the privacy protocol.But when the following command is executed snmpwalk -v3 -l authPriv -u user -a SHA -A authpass -x AES256 -X privpass device_ip:161 oid It throws the following error Invalid privacy protocol specified after -x flag: AES256 but when i tried using AES128 encryption the snmpwalk worked perfectly fine,which made me think if AES192&256 features are supported if not why was it not included. The original SNMP RFC documents do not require those. Thus, along with other reasons Net-SNMP never supports them,

Strength of RSA Encrypting an AES Key

拟墨画扇 提交于 2019-12-03 16:25:29
I'm currently developing a system to transmit data between client and server, and was wondering what the strength of the encryption I planned to use was. My thought was to have a private/public RSA key pair and hand out the public key to each client (leaving the private key solely on the server). Each client would then generate their own AES key and RSA encrypt it. They would then AES encrypt their data and send the encrypted data and encrypted AES key to the server. The server would then decrypt the AES key using the private key, and then decrypt the data using the AES key. Are there any

GSSException: [..] Encryption type AES256CTS mode with HMAC SHA1-96 is not supported/enabled

喜夏-厌秋 提交于 2019-12-03 16:02:28
After setting our domain users to support AES encryption for Kerberos tokens (Windows Server 2008R2), on a web-application server side we get the following exception: GSSException: Failure unspecified at GSS-API level (Mechanism level: Encryption type AES256CTS mode with HMAC SHA1-96 is not supported/enabled) Strangely we have Java 6 (1.6.0_27) , which means that AES should be supported, according to this document: http://docs.oracle.com/javase/6/docs/technotes/guides/security/jgss/jgss-features.html Any ideas what's missing in our web-application or Java, or third parties? We are using Spring

How to decrypt AES-128 encrypted m3u8 video files?

蹲街弑〆低调 提交于 2019-12-03 15:55:43
I trying to decrypt AES-128 encrypted m3u8 video files such as this one : the m3u8 file : #EXTM3U #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-ALLOW-CACHE:NO #EXT-X-VERSION:2 #EXT-X-FAXS-CM:MII6lAYJKoZIhvcNAQcCoII6hTCCOoECAQExCzAJBgUrDgMCGgUAM... very long key... #EXT-X-KEY:METHOD=AES-128,URI="faxs://faxs.adobe.com",IV=0X99b74007b6254e4bd1c6e03631cad15b #EXT-X-TARGETDURATION:8 #EXTINF:8, video.mp4Frag1Num0.ts #EXTINF:8, video.mp4Frag1Num1.ts ... I've tried with openssl : openssl aes-128-cbc -d -kfile key.txt -iv 99b74007b6254e4bd1c6e03631cad15b -nosalt -in video_enc.ts -out video_dec.ts key.txt contains the