cbc

okHTTP Unable to find acceptable protocols(android)

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Sorry for my english. I try using libruary OKhttp, and i use https for post reqest. Now i have error, when i try post my example, this is error: java.net.UnknownServiceException: Unable to find acceptable protocols. isFallback=false, modes=[ConnectionSpec(cipherSuites=[TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE

Enable TLSv1 ciphers in Spring Boot

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to enable TLSv1 ciphers in my spring boot REST service so that older android clients can connect to it but it is not working for some reason. I'm running openjdk version "1.8.0_131" and by default TLSv1, TLSv1.1 and TLSv1.2 seem to be enabled I'm using nmap --script ssl-enum-ciphers -p 8443 127.0.0.1 to scan what the server can take and I'm getting this 8443/tcp open https-alt | ssl-enum-ciphers: | TLSv1.2: | ciphers: | TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 (secp256k1) - A | TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 (secp521r1) -

OpenSSL AES 256 CBC via EVP api in C

匿名 (未验证) 提交于 2019-12-03 01:17:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What I am trying to do: Write a program in C that opens a file of arbitrary size and reads its contents. Once The contents are read it will encrypt them in AES 256 CBC and save the ciphertext to a file called ciphertext. Once this is saved it will close both files. Then will open the cipher text from the file that was just saved and decrypt the cipher text and save it to a file called decrypted. My Problem: It seems to never decrypt my cipher text. I get garbage, I have no idea what I am doing wrong. Please help. #include #include #include

AES-256/CBC encryption with OpenSSL and decryption in C#

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am a newbie to cryptography. My requirement is to decrypt/encrypt the text that is encrypted/decrypted using openssl. The algorithm that we are using is aes-256-cbc in the Openssl. So, I am trying to implement the same functionality in my application. so far after a lot of googling all i was able to do is.. private static string Encryptor ( string TextToEncrypt ) { //Turn the plaintext into a byte array. byte [] PlainTextBytes = System . Text . ASCIIEncoding . ASCII . GetBytes ( TextToEncrypt ); //Setup the AES providor for our

EIdOSSLUnderlyingCryptoError and “Error connecting with SSL. error:14094410…”

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a problem with Indy components in Delphi 10.1 Berlin on OS X. I'm using TIdHTTP to connect to a webservice using HTTPS. The problem is connecting to a server from an OS X client. When running on OS X, I get this same error all the time: Project raised exception class EIdOSSLUnderlyingCryptoError with message 'Error connecting with SSL. error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure'. I set the TIdHTTP.IOHandler property to use OpenSSL: IdHTTP.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); On OS X,

InvalidCiphertext exception when decrypting ciphertext

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm working in a new protocol for secure communication and I'm having problems to decrypt the ciphertext. The data packet is saved in a uint8_t* variable and encrypted. Until this part is all going well. But when I try to decrypt I got the followings problems: 1) If I send the vector and the size (it's really 20 but I just want to decrypt the last 16 bytes): CBC_Mode< AES >::Decryption decryptor; decryptor.SetKeyWithIV( key, CryptoPP::AES::DEFAULT_KEYLENGTH, iv ); CryptoPP::StringSource ss( vector+4, 16 , true, new CryptoPP:

HMAC-SHA256 with AES-256 in CBC mode

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I recently came across the following code sample for encrypting a file with AES-256 CBC with a SHA-256 HMAC for authentication and validation: aes_key, hmac_key = self.keys # create a PKCS#7 pad to get us to `len(data) % 16 == 0` pad_length = 16 - len(data) % 16 data = data + (pad_length * chr(pad_length)) # get IV iv = os.urandom(16) # create cipher cipher = AES.new(aes_key, AES.MODE_CBC, iv) data = iv + cipher.encrypt(data) sig = hmac.new(hmac_key, data, hashlib.sha256).digest() # return the encrypted data (iv, followed by encrypted data,

(转)CBC模式和ECB模式解读

匿名 (未验证) 提交于 2019-12-02 23:57:01
一 什么是CBC模式 CBC模式的全称是Cipher Block Chaining模式(密文分组链接模式),之所以叫这个名字,是因为密文分组像链条一样相互连接在一起。 在CBC模式中,首先将明文分组与前一个密文分组进行XOR运算,然后再进行加密。 CBC模式加解密过程如下: 我们来比较一下ECB模式与CBC模式的区别 ECB模式只进行了加密,而CBC模式则在加密之前进行了一次XOR。 二 初始化向量 当加密第一个明文分组时,由于不存在“前一个密文分组”,因此需要事先准备一个长度为一个分组的比特序列来代替“前一个密文分组”,这个比特序列称为初始化向量(Initialization Vector),通常缩写为IV,一般来说,每次加密时都会随机产生一个不同的比特序列来作为初始化向量。 三 CBC模式的特点 明文分组在加密之前一定会与“前一个密文分组”进行XOR运算,因此即使明文分组1和明文分组2的值是相等的,密文分组1和2的值也不一定是相等的。这样一来,ECB模式的缺陷在CBC模式中就不存在了。 加密过程:在CBC模式中,无法单独对一个中间的明文分组进行加密。例如,如果要生成密文分组3,则至少需要凑齐明文分组1、2、3才行。 解密过程:假设CBC模式加密的密文分组中有一个分组损坏了。在这种情况下,只要密文分组的长度没有发生变化,则解密时最多只有2个分组受到数据损坏的影响。见下图:

python笔记43-加解密AES/CBC/pkcs7padding

匿名 (未验证) 提交于 2019-12-02 22:51:30
有些公司对接口的安全要求比较高,传参数的时候,不会明文的传输,先对接口加密,返回的数据也加密返回。 目前比较常见的加密方式是AES/CBC/pkcs7padding。 在AES加密时,一般使用了“AES/ECB/NoPadding”或“AES/ECB/PKCS5padding” 或 “AES/ECB/PKCS5padding” 的模式 使用AES加密的ECB模式,显式指定加密算法为:CBC或CFB模式,可带上PKCS5Padding填充。AES密钥长度最少是128位,推荐使用256位 AES-ECB模式加密在加密和解密是需要一个初始化向量(Initialization Vector, IV),在每次加密之前或者解密之后,使用初始化向量与明文或密文异或。 分组密码有五种工作体制: 1.电码本模式(Electronic Codebook Book (ECB)); 2.密码分组链接模式(Cipher Block Chaining (CBC)); 3.计算器模式(Counter (CTR)); 4.密码反馈模式(Cipher FeedBack (CFB)); 5.输出反馈模式(Output FeedBack (OFB)) AES算法是典型的【对称加密算法】,所谓对称加密,就是加密和解密的秘钥是一样的 一般我们做接口自动化测试的时候,接口都是java写的,所以先得了解下java的加密方式

python 实现 DES CBC模式加解密

匿名 (未验证) 提交于 2019-12-02 22:51:30
# -*- coding=utf-8-*- from Crypto.Cipher import DES import base64 """ des cbc加密算法 padding : PKCS5 """ class DESUtil: __BLOCK_SIZE_8 = BLOCK_SIZE_8 = DES.block_size __IV = "\0\0\0\0\0\0\0\0" # __IV = chr(0)*8 @staticmethod def encryt(str, key): cipher = DES.new(key, DES.MODE_CBC, DESUtil.__IV) x = DESUtil.__BLOCK_SIZE_8 - (len(str) % DESUtil.__BLOCK_SIZE_8) if x != 0: str = str + chr(x)*x msg = cipher.encrypt(str) # msg = base64.urlsafe_b64encode(msg).replace('=', '') msg = base64.b64encode(msg) return msg @staticmethod def decrypt(enStr, key): cipher = DES.new(key, DES.MODE_CBC,DESUtil.__IV) #