Skip to content
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

Initial project setup #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
/docs/book
242 changes: 242 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "fortress"
version = "0.1.0"
edition = "2021"
authors = ["[email protected]"]
description = "FORTRESS is a software enclave similar to hardware keys such as yubikey and similar products. The main idea is to store sensitive data that is not directly accessible to the user. Rather, any cryptographic operation required, such as signing, encrypting, decrypting, etc., takes place inside a so-called vault: a fraction of the system memory that remains highly guarded and encrypted with the latest state-of-the-art encryption."
license = "Apache-2.0"
keywords = ["security","cryptography","virtualization"]

[[bin]]
name = "fortress"
path = "bin/main.rs"

[[test]]
name = "test_fortress"

[dependencies]
clap = { version = "4.5.16", features = ["derive"] }
fortress_shared = { package = "shared", path = "crates/shared"}

[workspace]
members = ["crates/*"]
68 changes: 68 additions & 0 deletions bin/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//! FORTRESS main application

use clap::{Parser, Subcommand};
use std::path::PathBuf;

#[derive(Parser, Debug)]
#[clap(about = include_str!("../logo.ascii"))]
pub struct Fortress {
#[clap(short, long, required = false)]
verbose: bool,

#[clap(
short,
long,
help = "Provide the path to the STORAGE file. Default is /path/to/user/STORAGE.json",
default_value = "STORAGE.json",
required = false
)]
storage: PathBuf,

#[clap(subcommand)]
cmd: Command,
}

#[derive(Subcommand, Debug, Clone)]
#[command(arg_required_else_help = true)]
pub enum Command {
#[clap(about = "Fetch a data entry")]
Fetch {
#[clap(short, long)]
key: String,
},

#[clap(about = "Stores a new data entry")]
Store,

#[clap(about = "Sign a <file> with given <token> to a private key with selected <algorithm>")]
Sign {
#[clap(short, long, help = "Signature algorithm to use")]
algorithm: String,

#[clap(short, long, help = "The token to access the private key")]
token: String,

#[clap(short, long, help = "The file to sign")]
file: PathBuf,
},

#[clap(about = "Create a new signature keypair. Returns a token to access the private key")]
Genkey {
#[clap(short, long, help = "The algorithm to use for keypair generation")]
algorithm: String,

#[clap(
short,
long,
help = "Token expire date. The `genkey` command will create an access token with an attached lifetime. "
)]
token_expire: String,
},

#[clap(about = "Runs the FORTRESS daemon.")]
Daemon,
}

fn main() {
let _ = Fortress::parse();
}
13 changes: 13 additions & 0 deletions crates/shared/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "shared"
version = "0.1.0"
edition = "2021"
authors = ["[email protected]"]
description = ""
license = "Apache-2.0"
keywords = ["security","cryptography","virtualization"]




[dependencies]
7 changes: 7 additions & 0 deletions crates/shared/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//! FORTRESS main shared module
//!
//! The main shared module provides all basic functionality of FORTRESS such as
//! - decrption / encryption
//! - storage of data
//! - signing
//! - verifying
6 changes: 6 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[book]
authors = ["FORTRESS Developers"]
language = "en"
multilingual = false
src = "src"
title = "FORTRESS Technical Documentation"
4 changes: 4 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Summary

- [Introduction](./chapter_1.md)
- [Specification](./chapter_1.md)
1 change: 1 addition & 0 deletions docs/src/chapter_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Chapter 1
6 changes: 6 additions & 0 deletions logo.ascii
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
_____ _____ _____ _____ _____ _____ _____ _____
| __| | __ |_ _| __ | __| __| __|
| __| | | -| | | | -| __|__ |__ |
|__| |_____|__|__| |_| |__|__|_____|_____|_____|

--=[ SECURE STORAGE APPLICATION]=--
1 change: 1 addition & 0 deletions tests/test_fortress.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@