| Zitat: |
| ________
Here's a description of the blowfish implementation used: 'We use blowfish 64-bit block cipher. The input string is treated as UTF-8 bytes which become the "key." The output from the encrypter (which is binary) is base64 encoded, and returned to JavaScript as a string. Decrypt takes the base64'ed string, converts it to the binary stream, and runs the blowfish 64-bit block decoder on it. It is assumed the same key "string" is used in both cases.' Let me know if more is needed. ______________ Just a few brief words of follow up on this topic for those interested in using these interfaces. First, we are aware of the limitations of this interface and desire for support for additional ciphers, hashes, etc. While as usual we can't comment on support timeframe we do recognize the importance of this functionality to developers. Second, there is an important detail to note about the current Blowfish implementation per the above explanation. All invocations use the same "zero" IV. This has two implications worth noting. The most important is that it can cause compatibility issues with external implementations. If your application is attempting to process data encrypted by an external source that used a different IV you will not be able to encrypt/decrypt the data. If you are encrypting data to send to another source you can specify the zero IV and they will be able to decrypt it. However if they send you data with a non-zero IV you will not be able to decrypt it. Also if they expect you to send data encrypted using a non-zero IV you will not be able to do so. This limitation will not have any effect on your ability to use the API locally to encrypt and save your own data. It is also worth nothing that reusing the same IV is not considered best practice in cryptography. Reusing IVs in Blowfish CFB mode is not a significant cryptanalysis issue if the data being encrypted varies in the first block. However if two plaintexts share identical first blocks, then an attacker who can view the ciphertext can see that they have identical first blocks, but not what the plaintext of those blocks is. Still, that knowledge may help the attacker in some way, depending on the structure of the plaintext. If you have concerns about even this minimal leakage of information, prepending a block of random data to the plaintext to be encrypted will have a similar effect. --brian |
1: | using System; |
1: | Blowfish bf = new Blowfish(BlowfishAlgorithm.CFB64); |
1: | using System; |
1: | using (Blowfish bf = new Blowfish(BlowfishAlgorithm.CFB64)) |
Entwickler-Ecke.de based on phpBB
Copyright 2002 - 2011 by Tino Teuber, Copyright 2011 - 2026 by Christian Stelzmann Alle Rechte vorbehalten.
Alle Beiträge stammen von dritten Personen und dürfen geltendes Recht nicht verletzen.
Entwickler-Ecke und die zugehörigen Webseiten distanzieren sich ausdrücklich von Fremdinhalten jeglicher Art!