From a94415dc55b244b0afad816dcede110d1f9dbead Mon Sep 17 00:00:00 2001 From: Didactic Drunk <1479616+didactic-drunk@users.noreply.github.com> Date: Sat, 12 Jun 2021 16:03:59 -0700 Subject: [PATCH] Init --- .editorconfig | 9 +++++++ .gitignore | 10 ++++++++ LICENSE | 21 +++++++++++++++++ README.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ shard.yml | 9 +++++++ 5 files changed, 114 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 shard.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..163eb75 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*.cr] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8a20578 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +/docs/ +/lib/ +/bin/ +/.shards/ +*.dwarf +*.swp + +# Libraries don't need dependency lock +# Dependencies will be locked in applications that use them +/shard.lock diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0353281 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 simple <(none)> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4ea223e --- /dev/null +++ b/README.md @@ -0,0 +1,65 @@ +# crypto_secret.cr +[![Crystal CI](https://github.com/didactic-drunk/crypto_secret.cr/actions/workflows/crystal.yml/badge.svg)](https://github.com/didactic-drunk/crypto_secret.cr/actions/workflows/crystal.yml) +[![GitHub release](https://img.shields.io/github/release/didactic-drunk/crypto_secret.cr.svg)](https://github.com/didactic-drunk/crypto_secret.cr/releases) +![GitHub commits since latest release (by date) for a branch](https://img.shields.io/github/commits-since/didactic-drunk/crypto_secret.cr/latest) +[![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://didactic-drunk.github.io/crypto_secret.cr/master) + +Interface intended to hold sensitive information. + +## Installation + +1. Add the dependency to your `shard.yml`: + + ```yaml + dependencies: + crypto_secret: + github: didactic-drunk/crypto_secret + ``` + +2. Run `shards install` + +## Usage + +```crystal +require "crypto_secret/not" + +not_secret = Crypto::Secret::Not.new 32 +``` + +## Implementing a new Secret holding class + +**Intended for use by crypto library authors** + +``` +class MySecret + include Crypto::Secret + + def initialize(size) + # allocate storage + # optionally mlock + end + + def to_slice : Bytes + # Return a slice + # Slice.new pointer, size + end + + # optionally override [noaccess, readonly, readwrite] +end + +``` + +## Contributing + +1. Fork it () +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create a new Pull Request + +## Contributors + +- [simple](https://github.com/your-github-user) - creator and maintainer +- [didactic-drunk](https://github.com/didactic-drunk) - current maintainer +[![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://didactic-drunk.github.io/sodium.cr/master) +# sodium.cr diff --git a/shard.yml b/shard.yml new file mode 100644 index 0000000..194a27b --- /dev/null +++ b/shard.yml @@ -0,0 +1,9 @@ +name: crypto_secret +version: 0.1.0 + +authors: + - Didactic Drunk <1479616+didactic-drunk@users.noreply.github.com> + +crystal: 1.0.0 + +license: MIT