Giter Club home page Giter Club logo

krypt's Introduction

krypt

Kotlin multi-platform cryptographic utility library.
GitHub tag (latest by date)

Usage

This library provides independent modules that handle specific cryptographic tasks. For instance, the krypt-csprng module provides a SecureRandom implementation which is a cryptographically strong psuedo-random number generator. Each module contains a README file with more information on usage.

Building

The library is provided through Repsy.io. Checkout the releases page to get the latest version.

Repository

repositories {
    maven { url = uri("https://repo.repsy.io/mvn/chrynan/public") }
}

Dependencies

ore:

implementation("com.chrynan.krypt:krypt-core:$VERSION")

csprng:

implementation("com.chrynan.krypt:krypt-csprng:$VERSION")

encoding:

implementation("com.chrynan.krypt:krypt-encoding:$VERSION")

hash:

implementation("com.chrynan.krypt:krypt-hash:$VERSION")

hash-argon:

implementation("com.chrynan.krypt:krypt-hash-argon:$VERSION")

hash-sha:

implementation("com.chrynan.krypt:krypt-hash-sha:$VERSION")

srp:

implementation("com.chrynan.krypt:krypt-srp:$VERSION")

Status

This project is in early development stages and is not yet considered production ready.

Documentation

More detailed documentation is available in the docs folder. The entry point to the documentation can be found here.

Security

For security vulnerabilities, concerns, or issues, please responsibly disclose the information either by opening a public GitHub Issue or reaching out to the project owner.

License

Copyright 2022 chRyNaN

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

krypt's People

Contributors

chrynan avatar darronschall avatar

Stargazers

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

Watchers

 avatar

krypt's Issues

`require` precondition in `SecureRandom` `nextBits` actuals is inverted

When checking that bitCount is in the correct range, the require precondition condition is flipped. It currently reads as:

require((bitCount < 0) or (bitCount > 32)) { "bitCount property must be in the range 0 to 32." }

... in all of the following places:

This prevents SecureRandom from being used since it's requiring an invalid bitCount. The precondition should instead be changed to:

require(bitCount in 0..32) { "bitCount property must be in the range 0 to 32." }

`kotlin.ArrayIndexOutOfBoundsException` in `IosSecureRandom.kt`

Hello! Thanks again for your KMM SecureRandom implementation. I've been able to use it successfully in an Android application since the 0.2.0 release, but I'm still having trouble with iOS.

This code:

val bytes = SecureRandom().nextBytes(32)

... works well on Android, but throws the following runtime exception on iOS:

Uncaught Kotlin exception: kotlin.ArrayIndexOutOfBoundsException
    at 0   shared                              0x103b479e3        kfun:kotlin.Throwable#<init>(){} + 75 
    at 1   shared                              0x103b40693        kfun:kotlin.Exception#<init>(){} + 67 
    at 2   shared                              0x103b408e7        kfun:kotlin.RuntimeException#<init>(){} + 67 
    at 3   shared                              0x103b40c6b        kfun:kotlin.IndexOutOfBoundsException#<init>(){} + 67 
    at 4   shared                              0x103b4156b        kfun:kotlin.ArrayIndexOutOfBoundsException#<init>(){} + 67 
    at 5   shared                              0x103b744c3        ThrowArrayIndexOutOfBoundsException + 107 
    at 6   shared                              0x104180693        Kotlin_ByteArray_set + 43 
    at 7   shared                              0x103f9bd33        kfun:com.chrynan.krypt.csprng.SecureRandom#nextBits(kotlin.Int){}kotlin.Int + 1375 
    at 8   shared                              0x103c341b3        kfun:kotlin.random.Random#nextInt(){}kotlin.Int + 87 
    at 9   shared                              0x103c35397        kfun:kotlin.random.Random#nextBytes(kotlin.ByteArray;kotlin.Int;kotlin.Int){}kotlin.ByteArray + 1079 
    at 10  shared                              0x103c35813        kfun:kotlin.random.Random#nextBytes(kotlin.ByteArray){}kotlin.ByteArray + 159 
    at 11  shared                              0x103c35923        kfun:kotlin.random.Random#nextBytes(kotlin.Int){}kotlin.ByteArray + 219 

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.