Comments (4)
If parameters are serializable, please don't forget to implement hashCode
and the == operator.
Btw, glad you're on cipher again :)
On Wed, Oct 15, 2014 at 10:56 PM, Ivan Zaera [email protected]
wrote:
The idea is that a non-randomized algorithm state can be
serialized/recovered with just its CipherParameters. I mean: if two
algorithms with the same name receive the same CipherParameters, they must
result in the same outputs for the same data.Of course, this cannot be done if some algorithm is randomized, but in
that case, the SecureRandom should be specified in the name so that it is
made explicit. And also, it would still be considered the same algorithm,
it's just that the randomization is different.This change will allow to merge in pull request #82
#82 that implements hashCode and
equals for all CipherParameters.If I cannot express SecureRandom as algorithm names and I cannot get rid
of ParametersWithRandom, I won't merge it in because I don't like to have
unstable semantics for these methods.—
Reply to this email directly or view it on GitHub
#87.
from cipher.
This bug is because of that PR ;-). It made me think about why ParametersWithRandom cannot implement equals and I think it's because there's something wrong with it. It's the only place where we are passing an "executable" object as a parameter. All other parameters are just data.
BTW: I've been always on cipher, it's just that I've been doing the entropy thing and it made me lose a lot of time. I'll upload the new spin off project soon.
from cipher.
I'll remove the init() method and the initialization parameters will be provided in the constructor with a simple syntax resembling a DSL.
For example, AES/CBC for encryption will be instantiated like this:
final aescbc = new BlockCipher("AES/CBC", {
Param.ForEncryption: true,
Param.Chain: [{
Param.Key: [0x00,0x11,0x22,...,0xDD,0xEE,0xFF]
}, {
Param.IV: [0x00,0x11,0x22,...,0xDD,0xEE,0xFF]
}]
});
The first param (ForEncryption) is passed to both AES and CBC. The ones inside the Chain are passed as the order in the algorithm name, i.e., the first one (Key) is for AES and the second (IV) for CBC.
Another benefit of this approach is that reset() is now easily implementable and semantically defined because it returns the state to the same point when the algorithm was created. Also, a new getter for the parameters will be provided that can be used in addition to the algorithmName to serialize the full definition of an algorithm.
from cipher.
This issue was moved to PointyCastle/pointycastle#87
from cipher.
Related Issues (20)
- Create a default SecureRandom implementation which seeds itself from the default EntropySource HOT 9
- Use CRT for RSA signing HOT 2
- CBC mode resets underlying cipher when init() is called HOT 1
- Standardize and make unit tests of init and reset methods HOT 1
- PaddedBlockCipher doesn't add padding when data length is a multiple of the block size HOT 23
- PaddedBlockCipher throws RangeError when empty byte array is inserted HOT 2
- Dually license the project under Mozilla Public License as well as under LGPL HOT 1
- Spin off entropy to another project and make cipher independent of client/server HOT 2
- Create a default SecureRandom that can be seeded with a public API function HOT 1
- Implement DER encoding for all Signature classes HOT 2
- Secure Random Constructor for Asymmetric Block Ciphers HOT 1
- MD5 and HMAC-SHA1 HOT 4
- When the input is long enough, SHA384 often returns wrong result. for short input like 10 20 bytes, it seems to be fine HOT 1
- HMAC-SHA512 giving inconsistent and incorrect output. HOT 1
- SHA-256/ECDSA signer gives invalid results with some inputs HOT 1
- GCM HOT 1
- Fix SHA-512 hash for use with Flutter. HOT 5
- Strong mode support HOT 1
- Feature request: Dart 2.0.0+ support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cipher.