An open API service indexing awesome lists of open source software.

https://github.com/rexops/rex-certencryption

Encrypt your data with OpenSSL/RSA keys
https://github.com/rexops/rex-certencryption

Last synced: 12 months ago
JSON representation

Encrypt your data with OpenSSL/RSA keys

Awesome Lists containing this project

README

          

=pod

=head1 NAME

Certencryption - Store strings encrypted.

This is a module which stores strings (like passwords, private keys, ...) in a secure way. Certencryption uses OpenSSL private key for encryption.

=head1 SYNOPSIS

use Certencryption;

user "root";
password decrypt($encrypted_string);

=head1 USAGE

To use this module you need a private key with which you can decrypt your data. You also need a public key with which you can encrypt your data.

=head2 KEY GENERATION

To generate a public/private keypair you can use the provided I task.

rex Certencryption:generate_key [--name=default [--size=4096]]

This will create a folder I and place the two keyfiles in it.

=head2 REXFILE

To encrypt or decrypt strings you have to include the I module in your Rexfile.

use Certencryption;

key_file "keys/default";

user "root";
password decrypt($encrypted_string);

The I command tells the module which key file it should use for the decryption. To encrypt a string you also need to have a public key. In this example the public key should be found in I.

my $base64_encrypted_string = encrypt("this is secret");

=head2 PADDING

To define which padding should be used, you can define this with the I function. The default is I. Valid padding option are:

=over 4

=item pkcs1_oaep (default)

=item pkcs1

=item sslv23 (due to a bug, only for decryption)

=back

=head1 COPYRIGHT

Copyright 2015 FILIADATA GmbH

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.