-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make security properties of block cypher etc. evident in types #5
Comments
Thanks for that paper. I’ve done some work in IFC, and have had it in the back of my mind to consider how it can be integrated with dependent types. I agree that we need to express stronger properties, and some of that may be in the types, but there are other approaches as well. EG, class BlockCipher bc => VerifiedBlockCipher bc where
notIdentity : key -> block -> Not (block = encryptBlock key block)
... This allows ciphers to be implemented more quickly, and then later have those security properties proven, while allowing users to constrain to only verified ciphers when possible (look at Prelude.Algebra for some examples of this). We could even use some psychological pressure to encourage the use of verified ciphers by doing class BlockCipher k where
weakEncryptBlock : k -> Bits bitsPerBlock -> Bits bitsPerBlock
class BlockCipher k => VerifiedBlockCipher where
instance BlockCipher k where
weakEncryptBlock = encryptBlock
encryptBlock k -> BitsWithMoreProperties -> BitsWithMoreProperties now every call with an unverified cipher nags at you. And properties that should hold only for particular ciphers can also be proven stand-alone (without affecting the type). I’ve also been playing with some kind of wrapper type (I should make branches, to expose these experiments) to contain more arbitrary properties. Effectively, Expect wiki and branch updates today to reflect all of this rambling, and I am happy to accept any PRs that give us stronger guarantees. |
OK, yes, I'm familiar with the unverified and verified Algebra stuff, and that's a reasonable approach. And yes, please, use the psychological pressure. I suggest the shorter BlockCipher name for the type with more properties and a more obscure name a la UnverifiedDontUseThisUnlessYouReallyWantToPointTheGunAtYourOwnFootBlockCypher for the plain one. Perhaps weakEncryptBlock vs encryptBlock could get the message across, but even weakEncryptBlock suggests there's some sort of encryption going on. transformBlock comes to mind. As to PRs, I'm afraid I'm a long way off from understanding how to port what I learned from rF* to idris. I had to look up IFC ;-) |
I just pushed my current idea of the Very open to suggestion. |
I wonder if discrete labels like that are sufficiently expressive, or if things like "the attacker will have to explore on average 2^n guesses" will be needed. Meanwhile... I found a link from the rF* style of types and proofs to Isabelle/HOL, and to my understanding, the Isabelle/HOL type system is in the same neighborhood as idris's.
seL4: from General Purpose to a Proof of Information Flow Enforcement The seL4 information flow security seems to use discrete labels too, so that approach does seem pretty useful. |
I found the Probabilistic relational verification types work in the F* project very interesting:
I'm not quite sure how well F* effects translate to idris effects, but it seems to me that it's essential to represent these security properties in the types, and not just the number of bits and bytes in the input and output parameters.
All this type tells me is that the function goes from some number of bits to bits; it doesn't express any actual security properties:
The identity function satisfies that type, as do constant functions, etc.
The text was updated successfully, but these errors were encountered: