Skip to content

Commit 3354e78

Browse files
committed
Version increment. README updated.
1 parent cc92cf9 commit 3354e78

File tree

3 files changed

+67
-61
lines changed

3 files changed

+67
-61
lines changed

ObscurCore.DTO/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[assembly: AssemblyConfiguration("")]
1010
[assembly: AssemblyCompany("")]
1111
[assembly: AssemblyProduct("ObscurCore")]
12-
[assembly: AssemblyCopyright("Copyright © 2014")]
12+
[assembly: AssemblyCopyright("Copyright © Matthew Ducker 2014")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

@@ -28,5 +28,5 @@
2828
// Build Number
2929
// Revision
3030
//
31-
[assembly: AssemblyVersion("0.8.0.0")]
32-
[assembly: AssemblyFileVersion("0.8.0.0")]
31+
[assembly: AssemblyVersion("0.9.0.0")]
32+
[assembly: AssemblyFileVersion("0.9.0.0")]

ObscurCore/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[assembly: AssemblyConfiguration("")]
1010
[assembly: AssemblyCompany("")]
1111
[assembly: AssemblyProduct("ObscurCore")]
12-
[assembly: AssemblyCopyright("Copyright © 2014")]
12+
[assembly: AssemblyCopyright("Copyright © Matthew Ducker 2014")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

@@ -28,5 +28,5 @@
2828
// Build Number
2929
// Revision
3030
//
31-
[assembly: AssemblyVersion("0.8.0.0")]
32-
[assembly: AssemblyFileVersion("0.8.0.0")]
31+
[assembly: AssemblyVersion("0.9.0.0")]
32+
[assembly: AssemblyFileVersion("0.9.0.0")]

README.md

Lines changed: 61 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ObscurCore
22
==========
33

4-
A general purpose, easy to use, highly customisable and extensible encryption and data packaging library.
4+
A general purpose, customisable, and extensible encryption and data packaging library.
55

66
Thanks
77
------
@@ -14,6 +14,8 @@ This work is built heavily on top of theirs, and likely would not have been poss
1414

1515
Also a big thanks to **Marc Gravell** for his excellent [protobuf-net](https://code.google.com/p/protobuf-net/) and its associated serialisation assembly precompiler. It is used extensively throughout (especially for the packaging features) and provides great flexibility and performance.
1616

17+
And finally, to [LZ4 for .NET](https://lz4net.codeplex.com/). It is used, optionally, for compression of package manifests, where it has excellent speed.
18+
1719

1820
Why use this?
1921
-------------
@@ -39,18 +41,45 @@ Now that that's out of the way, here's how you can use it for doing some stuff!
3941
ObscurCore Packaging System
4042
---------------------------
4143

42-
**Please note that this part of the API is new and is subject to change on its way to a stable release. I'll try to minimise this, but the fact remains.**
44+
**Please note that this part of the API is subject to change on its way to a stable release. I'll try to minimise this, but the fact remains. Now it has reached v0.9, it should change very little.**
45+
*****
46+
47+
This feature is an automated system that acts somewhat like an very paranoid archive/packaging format.
48+
It allows you to bundle together collections of data, text, and cryptographic keys. You need not care about the details if you don't want to (conservative defaults are used), but if want to, you can heavily customise.
49+
50+
*Note: If you don't want to use the packager, but are instead interested in the general-purpose crypto, skip this entire section.*
51+
4352

44-
This feature is an automated system that acts somewhat like an very paranoid archive format.
45-
It allows you to bundle together collections of messages, data, and key agreements/actions.
53+
### What does it look like to use? ###
4654

47-
The index of the archive is encrypted too, as with the actual contents. Each item has its own unique encryption configuration, so you can have plausible deniability by using different keys on different items, and/or including decoy/fake items if needed.
55+
using (var output = new MemoryStream()) {
56+
var package = new Package(key);
57+
package.AddFile(filePath);
58+
package.Write(output);
59+
}
60+
61+
you can also add an entire directory (optionally including subdirectories) at once:
62+
package.AddDirectory(path)
63+
package.AddDirectory(string path, search : SearchOption.AllDirectories) // including subdirectories
64+
65+
66+
Pretty easy?
67+
68+
You *can* stop reading here, if you have no interest in the technical parts. You really don't need to know, but it might be easier with some knowledge of the technicalities.
69+
70+
71+
### How does it work? ###
72+
73+
At basics, a package consists of a Manifest and Payload. The manifest (a sort of description of contents, an index) is encrypted, as with the actual contents.
74+
The payload consists of items, and each item has its own unique encryption configuration, so you can have plausible deniability by using different keys on different items, and/or including decoy/fake items if needed.
4875
If deniability is not needed, one could use this feature by distributing a package to multiple recipients, with the different items encrypted with recipient-specific keys, so each sees only that which they are able to decrypt.
4976

50-
The index of the archive (where all the information about the items in the archive is kept), termed a *manifest* in ObscurCore nonclemature, is encrypted with a choice of schemes:
77+
The manifest is encrypted with a choice of schemes:
5178

5279
+ Symmetric cipher (participants must share secret key securely somehow)
53-
+ UM1-hybrid (ephemeral-static-static elliptic curve Diffie-Hellman)
80+
+ UM1-hybrid (ephemeral-static-static elliptic curve Diffie-Hellman, so-called *Unified Model 1-pass*)
81+
82+
The latter doesn't use a secret key which has to be somehow communicated to the other party, instead you just exchange 'public keys', so named because you don't need to keep them secret.
5483

5584
The hybrid scheme derives a key from the public key cryptosystem, derives it further with a KDF, and uses this as the key for a symmetric cipher.
5685
The symmetric-only scheme derives the supplied shared key further with a KDF, and uses this as the key for a symmetric cipher.
@@ -65,32 +94,27 @@ Simple just concatenates them together in varied (or sequential) order.
6594
Frameshift does the same but inserts variable (or fixed) lengths of bytes before and after each item.
6695
Fabric multiplexes variable (or fixed) length stripes of each item, mixing them all up, much like the Rubberhose file system.
6796

68-
Where variable ordering/lengths are used, these are assigned by the use of a CSPRNG, so the recipient can decrypt - if it was actually random, this would be impossible.
69-
70-
All items and their configurations, along with the manifest and its configuration, are authenticated with a MAC in the **Encrypt-then-MAC (EtM)** scheme, which provides strong verification and minimum information leakage. Upon detection of any alteration, all operations are aborted.
97+
Where variable ordering/lengths are used, these are assigned by the use of a cryptographically-secure pseudorandom number generator.
7198

99+
All data is authenticated with a MAC in the **Encrypt-then-MAC (EtM)** scheme, which provides strong verification and minimum information leakage. Upon detection of any alteration, all operations are aborted.
72100

73-
Here's an example using the packager:
74101

75-
using (var output = new MemoryStream()) {
76-
var package = new Package(key);
77-
package.AddFile(filePath);
78-
package.Write(output);
79-
}
80-
81-
The above...
82-
* Creates the symmetric-encryption package, the manifest being configured to use XSalsa20 encryption, Keccak256 key confirmation, Keccak256 authentication, and scrypt key derivation
102+
In the code example above/before, the packager performs the following actions automatically...
103+
* Creates the symmetric-encryption package, the manifest being configured to use XSalsa20 encryption, Keccak-256 (SHA-3-256) key confirmation, Keccak-512 (SHA-3-512) authentication, and Scrypt key derivation
83104
* The package is set up with frameshifting payload layout (default) and a Salsa20-based CSPRNG
84-
* Adds a file to a package with HC-128 encryption (random key & IV, default) and Poly1305-AES EtM authentication (random key and nonce, default). Key confirmation and derivation is not used due to the keys being random and stored in the manifest. If keys are to be supplied by recipient, then the defaults are Keccak256 key confirmation and scrypt key derivation.
85-
* Derives a package/manifest key (from the supplied one) with scrypt KDF
105+
* Adds a file to a package with HC-128 encryption (random key & IV, default) and Poly1305-AES EtM authentication (random key and nonce, default). Key confirmation and derivation is not used due to the keys being random and stored in the manifest, in this instance. If keys are to be supplied by recipient, then the defaults are Keccak-256 key confirmation and scrypt key derivation.
106+
* Derives a package/manifest key (from the supplied one) with Scrypt KDF
86107
* Writes it out to the output stream
87108

88109

89-
All schemes offer key confirmation capability with a choice of algorithms (e.g. MAC, KDF, etc.)
110+
All schemes offer key confirmation capability with a choice between MAC or KDF method.
90111

91112
If a package is recieived from a sender for which you hold multiple keys on file for (whatever kind they may be), all them will be verified with the key confirmation data (if present, which it is by default - generated automatically) to determine the correct one to proceed with.
92113

93-
Packages include the capability to communicate new keys (of any kind), or request invalidation of keys for subsequent communications. For example, you could send a symmetric key for manifests, so as to reduce overhead incurred by public key schemes.
114+
115+
In future: packages will include the capability to communicate new keys (of any kind), or request invalidation of keys for subsequent communications. For example, you could send a symmetric key for manifests, so as to reduce overhead incurred by public key schemes.
116+
117+
94118

95119

96120
Functionality exposed through streams
@@ -100,9 +124,9 @@ Functionality exposed through streams
100124

101125
### Encryption/decryption ###
102126

103-
var config = SymmetricCipherConfigurationFactory.CreateBlockCipherConfiguration(SymmetricBlockCipher.Aes,
127+
var config = CipherConfigurationFactory.CreateBlockCipherConfiguration(BlockCipher.Aes,
104128
BlockCipherMode.Ctr, BlockCipherPadding.None);
105-
using (var cs = new SymmetricCryptoStream(destStream, encrypting:true, config, keyBytes, closeOnDispose:false) ) {
129+
using (var cs = new CipherStream(destStream, encrypting:true, config, keyBytes, closeOnDispose:false) ) {
106130
sourceStream.CopyTo(cs);
107131
}
108132

@@ -189,13 +213,12 @@ These are in serious need of a convenience method. It's on the list.
189213
### Key agreements ###
190214

191215
Please note that currently, perfect-forward-secrecy ECDH algorithms (such as 3-pass Full Unified Model; UM3) are not implemented. Sorry!
192-
Work has started on implementing the *Axolotl Ratchet* for another manifest cryptography scheme.
193216

194217
There are, however, implemented UM1-type agreements, which provide unilateral forward secrecy - which is much better than nothing.
195218

196219
J-PAKE password-authenticated key agreement is also available, using ECC instead of DSA, making for very secure and fast agreements.
197220

198-
Elliptic curves provided are from the Brainpool Consortium and SEC2 (secp and sect curves; also called NIST curves). These are the most popular choices.
221+
Elliptic curves provided are from the Brainpool Consortium, SEC2 (secp and sect curves; also called NIST curves), and Daniel J. Bernstein. These are the most popular choices.
199222

200223

201224
Creating keys:
@@ -205,27 +228,27 @@ Creating keys:
205228
And calculating shared secret:
206229

207230
EcKeyConfiguration ephemeral;
208-
byte[] initiatorSS = UM1Exchange.Initiate(senderKeypair.ExportPublicKey(), senderKeypair.GetPrivateKey(), out ephemeral);
209-
byte[] responderSS = UM1Exchange.Respond(receiverKeypair.ExportPublicKey(), receiverKeypair.GetPrivateKey(), ephemeral);
231+
byte[] initiatorSS = Um1Exchange.Initiate(senderKeypair.ExportPublicKey(), senderKeypair.GetPrivateKey(), out ephemeral);
232+
byte[] responderSS = Um1Exchange.Respond(receiverKeypair.ExportPublicKey(), receiverKeypair.GetPrivateKey(), ephemeral);
210233

211234

212235
### Signatures ###
213236

214-
No concrete implementation is yet in place. ECDSA is being added.
215-
The preferred example of this is Ed25519.
237+
No concrete implementation is yet in place. ECDSA is being added - the preferred example of this is Ed25519.
216238
DSA proper (using RSA) will most likely not be added due to concerns with security and efficiency.
217239
Watch this space.
218240

219241

220242
Some words on Streams
221243
---------------------
222244

223-
SymmetricCryptoStream **encrypts only when being written to**, and **decrypts only when being read from**. The other core stream types (for example, the HashStream) do not enforce directionality like this.
245+
CipherStream **encrypts only when being written to**, and **decrypts only when being read from**. The other core stream types (for example, the HashStream) do not enforce directionality like this.
224246

225247
ObscurCore uses stream decorators for I/O, so anything that is derived from the abstract Stream class of the .NET BCL can be plugged into the constructor of an ObscurCore *SymmetricCryptoStream/HashStream/MacStream*. This means in practice pretty much anything, since pretty much anything can be serialised to a byte array.
226248

249+
Please note that ObscurCore's main stream classes **close on dispose by default**. The reason for this is to ensure the stream that it's bound to gets closed. Most (all?) of the .NET BCL streams are the same, the difference here is that you get a choice, because you may only want to finish the cipher operation but retain the underlying bound stream(s).
227250

228-
Please note that ObscurCore's main stream classes **close on dispose by default**. This means the stream they were bound to on construction will be closed with it, when the wrapping ObscurCore stream is closed/disposed.
251+
This means the stream they were bound to on construction will be closed with it, when the wrapping ObscurCore stream is closed/disposed.
229252
Don't make the mistake of thinking stuff isn't working when binding on a MemoryStream, and wondering why the data is missing afterward.
230253

231254
The main stream classes have a parameter, *closeOnDispose*, that controls this. Set it to **false** if you *don't* want them to close. They're set to *true* by default to try and ensure that if they're bound to a FileStream, the OS hooks get disposed of properly.
@@ -239,43 +262,26 @@ Recommendations
239262

240263
The author's recommendations, among block ciphers:
241264

242-
+ AES/CTR
243-
+ Twofish/CTR
244-
+ Serpent/CTR
265+
+ AES in CTR mode
266+
+ Twofish in CTR mode
267+
+ Serpent in CTR mode
245268

246269
and in stream ciphers:
247270

248-
+ HC-128
249-
+ SOSEMANUK
250271
+ XSalsa20
272+
+ HC-128
251273

252274
In hash and MAC functions:
253275

276+
+ Keccak/SHA-3
254277
+ BLAKE2B
255278
+ Poly1305-AES
256-
+ Keccak/SHA-3
257279

258280
In KDFs:
259281

260282
+ Scrypt
261283

262-
Advanced
263-
--------
264-
265-
Want to play around with the cryptographic primitives instead? This is not recommended, but you can.
266-
Have a look around the **Source** object. It provides easy instantiation and configuration of the most useful classes.
267-
268-
Some features of ObscurCore are only accessible this way currently, but that's soon to change. If you don't want to deal with low-level features, you shouldn't have to. That's the point of automation.
269-
270-
What's next?
271-
------------
272-
273-
Mostly, the work to come is tidying up the API. Style of use will ideally become more consistent, and less contact with intermediate objects will be required.
274-
275-
The next major planned feature is automatic nonce management.
276-
The idea is that you simply pass in a collection that conforms to a particular interface (whether this is just a reference to a simple in-memory database that's repopulated from disk on startup, or a *real* database), ObscurCore checks this DB whenever you reference a key, and makes sure it doesn't use the same nonce again when it's using a cryptographic scheme for which this is essential to maintain its security assurances.
277284

278-
Any suggestions or code checkins are appreciated!
279285

280286
Where can I get more information?
281287
---------------------------------

0 commit comments

Comments
 (0)