blowfish

Cipher.getInstance is too slow

跟風遠走 提交于 2019-12-13 03:39:12
问题 I have the following line of code that is taking less than a second on my computer (windows 7) and about 20 seconds on a Redhat server : Cipher cipher = Cipher.getInstance(TRANSFORMATION); where TRANSFORMATION is defind as : private static final String TRANSFORMATION = "Blowfish/ECB/PKCS5Padding"; What could be the source of such behaviour ? Thanks. 回答1: Initialization of the Bouncy Castle provider and - probably - a slow /dev/random . 来源: https://stackoverflow.com/questions/21757653/cipher

Blowfish in C#

泪湿孤枕 提交于 2019-12-12 18:07:29
问题 My C++ program is using a standard blowfish. My C# program is using the Blowfish encryption algorithm from here. Both applications (TCP Clients) do the same thing: receive a packet, encrypt it and then send it back. If the server recognises the packet as normal - it sends another packet, otherwise it closes the socket. I followed all functions in C++ and C# and everything is the same except the encryption. In the C++ file I have only one encryption. However, in the C# Blowfish I have

Cryptacular is broken

空扰寡人 提交于 2019-12-12 10:52:55
问题 this weekend our docker image broke because it cannot be build anymore. While looking into the stats, I saw this line: crypt_blowfish-1.2/crypt.h:17:23: fatal error: gnu-crypt.h: No such file or directory In more detail: Running setup.py bdist_wheel for cryptacular: started Running setup.py bdist_wheel for cryptacular: finished with status 'error' Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-sayd65k0/cryptacular/setup.py';f

C++ blowfish works with fewer letters,but C# blowfish doesn't

懵懂的女人 提交于 2019-12-11 16:00:02
问题 a C++ blowfish supports encrypting a block with less than < 8 letters,while .NET doesn't.Why? -->C# NET Blowfish<-- -->C++ Blowfish<-- In both C++ and C# applications,I encrypt the following array byte response[6] = { 0x00, 0x80, 0x01, 0x61, 0x05, 0x06 }; In both C++ and C# applications,I call the Encrypt function with same parameters. C++ Blowfish.Encrypt((LPBYTE)responce + 2,(LPBYTE)responce + 2, 4); C# Blowfish.Encrypt(responce, 2, responce, 2, responce.Length - 2); However,In C++ I get

IRC blowfish encryption mode?

左心房为你撑大大i 提交于 2019-12-11 11:07:54
问题 I've been doing some tests with this tool : http://crypto.hurlant.com/demo/CryptoDemo.swf and been trying to match blowfish results obtained from Mirc + blowfish (from what used to be fish.secure.us v1.30). I cannot for the life of me find what mode it is using... Nothing matches.. Does anyone know what mode it uses ?? 回答1: It simply uses ECB mode, but the base64 encoding is done in an odd way - each block of 32 bits of ciphertext is independently encoded into 6 base64 characters. 回答2:

problems understanding an open source Blowfish API

自作多情 提交于 2019-12-11 07:59:22
问题 process of encoding. its work byte[] key = Form1.StrToByteArray("1234567812345678");//secret key byte[] data = Form1.StrToByteArray("ololoololoololoololoololoololoololoololoololoololoololoololoaaas");//text for encoding Blowfish bf = new Blowfish(key);//start class bf.Encipher(data, 64);//64 is len string data string encoded_text = BitConverter.ToString(data).Replace("-", "").ToLowerInvariant();//take string and kill "-" and make to lower text textBox1.Text = encoded_text;//result

PHP Bcrypt hashing

蓝咒 提交于 2019-12-11 06:37:13
问题 I want to use Blowfish hashing to hash password. crypt() does not support it in PHP versions prior to 5.3 My PHP version is 5.2.14. How can I use Blowfish hashing? Can I use PEAR's Crypt_Blowfish instead? 回答1: PEAR's Crypt_Blowfish is meant to stand in for PHP's MCrypt extension - it's a two-way encryption scheme, not for hashing. While bcrypt is based on Blowfish, it's not the same thing. Confusingly, PHP 5.3.0's CRYPT_BLOWFISH is a hashing algorithm. Is there a reason why upgrading to PHP 5

Why is crypt() generating different results?

十年热恋 提交于 2019-12-10 19:17:09
问题 Crypt is generating different hashes with the same input data, and the [following] previously functional hash generator/check is no longer working for authenticating users: public static function blowfish($password, $storedpass = false) { //if encrypted data is passed, check it against input ($info) if ($storedpass) { if (substr($storedpass, 0, 60) == crypt($password, "$2y$08$".substr($storedpass, 60))) { return true; } else { return false; } } else { //make a salt and hash it with input, and

PHP crypt() Blowfish Function Not Working

寵の児 提交于 2019-12-10 13:56:57
问题 This is my first time using the crypt() function in PHP, and I can't figure out why it isn't working. My code is based on this article: http://www.techrepublic.com/blog/australia/securing-passwords-with-blowfish/1274 function blowfishHash ($pw) { //generate random salt $salt = "$2y$10$"; for ($i = 0; $i < 22; $i++) { $salt .= substr("./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", mt_rand(0, 63), 1); } $hash = crypt($pw, $salt); //printout to file $file = fopen("debug.txt",

Encrypt in C# and decrypt in Flex

蓝咒 提交于 2019-12-10 10:23:44
问题 I need to decrypt some data in Flex that is encrypted in C# and written to a file. I settled on blowfish for simplicity's sake using the as3crypto As3 library and Bruce Schneier C# library. AS3 as3crypto link Bruce Schneier C# blowfish link I can get a short string to encrypt in C# and decrypt in Flex fine however longer strings just fail to produce results and I do not know what I am missing? C#: string reportstring = "watson?"; BlowFish b = new BlowFish("04B915BA43FEB5B6"); string