Giter Club home page Giter Club logo

qabel-core's Introduction

Qabel documentation

For the documentation take a look at this page.

qabel

This repo is outdated and not used any more, see our android and desktop repo.

qabel-core's People

Contributors

abothe avatar audax avatar cburkert avatar enkore avatar f-porter avatar gottox avatar hash13 avatar jan-schreib avatar jasinai avatar jmt85 avatar jogir avatar julianseeger avatar l-henke avatar nannor avatar nnice avatar rehwanne avatar roeslpa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qabel-core's Issues

Mac OS X: Crypto tests fail/throw exceptions

I just ran the tests on my Macbook and two crypto tests (CryptoUtilsTest.encryptDecryptSymmetricTest() and CryptoUtilsTest.encryptHybridTest()) exited with an error and one (CryptoUtilsTest.encryptSymmetricTest()) failed. Beforehand in every test of CryptoUtilsTest (except in sha512Test()) a "InvalidKeyException: Illegal key size" is thrown.

Mac OS X version: 10.9.3
Java version: 1.7.0_67 (Travis CI runs with 1.7.0_60)

@L-Henke, maybe you have any idea why that happens?
Does someone else use Java version 1.7.0_67?

Implement basic crypto functionality

Implement basic crypto functionality to get used by the drop component or - to be more specific - so that basic Qabel contacts and identities can have crypto keys.

Singleton class for secure random bytes?

I guess we'll need secure random bytes in many different classes. Should there be a singleton class with a secure initialized random number generator? Maybe this could be part of a general cryptography related utility class.

Are QSVs untouchable while being (over)written?

Just thought about this question concerning possible race conditions for the sync component.

When uploading stuff into a QSV, will the server ensure that noone else/no other client etc can neither read nor write into the same QSV?
Perhaps it should be possible that a QSV may be readable while being written - but then the read procedure takes as long as the data is loaded up OR it just dumps an old version of the QSV's contents.

Create an own class for private keys

Currently, private keys in the identity are just represented as a string. An own class would be better, because is would allow private key related operations like getting the public key from a private key.

Add LICENSE file

and find out if this is enough (i.e. if no further license headers are needed).

Zip/compress JSONs before encrypting/sending them

This might reduce the time/bandwidth needed to encrypt or send all the data - but will obviously take some time to actually compress the strings + drop queries probably have a very small mem footprint anyway, so the zip's dictionary would only create overhead then.

Might be good to have some benchmarks or a rough estimation whether this is actually needed concerning the quota between encryption time vs. compression time.

Class structure - Config

I found a strange structure in the config (SyncedSettings & SyncedModuleSettings):

  • SyncedSettings contains:
    A member SyncedModuleSettings syncedModuleSettings and a Set syncedModuleSettings1.
  • SyncedModuleSettings contains:
    A member SyncedSettings syncedSettings1 and a Set< SyncedSettings> syncedSettings.

I know that the members syncedModuleSettings and syncedSettings are references of the containing classes. But for what reason does SyncedModuleSettings contain a Set of SyncedSettings?

Naming inconsistency server vs. servers

We use the term server for a single server and sometimes for more than one server. We also use the term servers for more than one server.

I suggest:

  • server for one server.
  • servers for e.g. a set of server(s) :)

Change url strings to java urls

As seen in @jasinai issue and pullreq #10 she changed String URLs to Java object URLs.
I think its a good idea. If everybody is fine with it I would open an issue to change the rest of the strings.

edit: typo

Evaluate necessity for using KeyGenerator to generate AES keys

We should check if it is really recommended to use JCA's KeyGenerator concept to generate AES keys instead of simply pulling the keys out of the random bytes source.

Here is a discussion on stackoverflow, which suggests the using of KeyGenerator as best practice.
Advantages of using KeyGenerator:

  • leave the randomness-related decisions to the provider

Topic: basic crypto #29

Avoid timing attack on drop message signature verification

During the decryption of drop messages, the routine currently iterates over all possible senders (contacts) and checks if the drop message signature has been created by the respective contact.

        for (Contact c : contacts.getContacts()) {
            plainJson = decryptDrop(cipherMessage.getBytes(),
                    c.getContactOwner().getPrimaryKeyPair(),
                    c.getSignaturePublicKey()
            );
            if (plainJson == null) {
                continue;
            } else {
                plainMessages.add(deserialize(plainJson));
                break;
            }
        }

This algorithm is prone to timing attacks, because the contact list is allways iterated in the same order and a passive attacker (capable of monitoring e.g. CPU utilization) could learn from the decryption time, that two drop messages have been written by the same contact.

To mitigate this problem, one could instead iterate the contact list in a randomized fashion.

Detail handling of module settings

Reviewing the settings concept, I noticed, that the *ModuleSettings classes contain no information as to which module they belong to.
This is currently missing, isn't it?

@Gottox Can you explain your idea behind the module settings handling?

Shouldn't there be a module identifier member in the AbstractModuleSettings class or something like this?

Implement Drop API

  • Implemnt API to send and receive drop messages
    • Implement interface for modules to do that (optional)

null vs. .Empty default object as emptyness indicator?

...to prevent all kinds of unforeseen NRE (null ref exceptions)

Just saw places like these which will likely cause unnecessary trouble because of returned null-objects.
Imo, we should stick to .Empty default objects, just like DropMessage<ModelObject>.Empty or so.

Qabel is still somewhat small, so converting all the things won't be that time-consuming for now.

Gradle sourceCompatibility

The build.gradle file sets sourceCompatibility = 1.6.
@thechauffeur said we will use Java 7 for development.
Wouldn't that mean the file should set it to sourceCompatibility = 1.7?

Output of java -version:

java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.1) (7u65-2.5.1-4ubuntu1~0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

@Gottox does it need to stay on 1.6 for Android?

When to update UML diagrams?

Just saw a PR (pullrequest) featuring changed Core API.
Since we've got only 2 UMLLab licenses (and because it's likely that most people are too lazy to update their diagrams immediately as well), we need to have an update policy concerning the diagram definition and exported diagram charts, imho.

In #10 I suggested that once a week, those Java => Uml conversions will happen in order to keep the documentation halfway updated. Does this sound reasonable? @Gottox @k-c13

Implement add() methods in config container classes

The functionality to add a new instance of a class to a container class should be encapsulated in an add() method (e.g. one would use identities.add(Identity identity) instead of identities.getIdentity().add(Identity identity). Thereby this functionality would be independent of the implementation of the collection in these container classes.

Update/beautify class diagram

The class diagram (core.png) in the repository looks kind of confusing and it is not clear which class diagram is the actual (the one in qabel-core or in qabel-doc repo).

Versioning and git branching model

Besides the documentation and the Qabel protocols - whether they may use the network or not - the code also needs versioning. We will use semver and we need to talk about the implications of doing so.

Since we will have some kind of a release in the near future (see attached milestone) this issue is here as a reminder.

Platform indepentent object persistance

We need a way to persist object on Android and PC without Android specific code. Maybe @Gottox know more about the persistence possibilities on Android and how this can be done platform independent.

Format code

@L-Henke started with #1 to reformat the code (variables on top, accessors and mutators below). We need to continue this work to have a consistend style in our code.

Model Classes must be registered

To prevent code injections, prior to dynamical instatiations of Model Classes, Modules must register the Model Classes they use.

this may be done in the init method of a module.

Update the config

The classes in the config package are not up-to-date. Update them.

Identify components which are vulnerable to timing attack

Since most of our communication is done asynchronous, only limited parts of the code should be vulnerable to timing attacks. These has to be identified.

  • Re-requests of corrupted communications might be critical
  • Drop messages which trigger a further action. (e.g. drop message that notifies about a modified file on the storage system)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.