I hereby claim:
- I am dmend on github.
- I am redrobot (https://keybase.io/redrobot) on keybase.
- I have a public key whose fingerprint is 4782 4516 424D 898B 54D6 48CC F229 4C99 E916 A3FB
To claim this, I am signing this object:
| # Use Case 1 | |
| # Generate and store the public key of an RSA 2048 keypair using POST+PUT | |
| # User Format: openssl default public key PEM. (aka SubjectPublicKeyInfo inside a PEM file with header/footer) | |
| # Transfer Format: None - File does not need to be encoded for transfer | |
| # Content-Type: application/octet-stream | |
| # Expected Format from Barbican: Identical PEM file | |
| # Create the RSA keypair | |
| openssl genrsa -out private.pem 2048 |
| # Use Case 1 | |
| # Generate private RSA Key in PKCS#8 format and store using POST+PUT | |
| # Media-Type: application/pkcs8 | |
| # Create the RSA keypair | |
| openssl genrsa -out private.pem 2048 | |
| # Convert from "traditional" to PKCS#8 | |
| openssl pkcs8 -topk8 -nocrypt -in private.pem -out private.pk8 | |
| # Submit a metadata-only POST |
| # Add new import | |
| from sqlalchemy_utils.types.password import PasswordType | |
| # Change password in User model | |
| password = db.Column(PasswordType( | |
| schemes=[ | |
| 'bcrypt', | |
| 'plaintext' | |
| ], | |
| deprecated=['plaintext'], |
| # Generate a new fernet key and save it to a file named encryption_key.txt | |
| >>> from cryptography.fernet import Fernet | |
| >>> Fernet.generate_key() | |
| # Load key from file in app.py | |
| with open(encryption_key.txt) as f: | |
| FERNET_KEY = f.read() | |
| # In the upload function, we want to encrypt the file | |
| @app.route("/upload", methods=["POST"]) |
| # import hmac library | |
| import hmac | |
| # configure a key | |
| HMAC_KEY = 'O\x8cNd\x16E\xb1U\x1b\x0b\xe8\t\xd8\xab\xbcI' | |
| # change signing function to use hmac | |
| ctx = hmac.new(KEY, digestmod=hashlib.sha256) | |
| ctx.update(request.args["data"]) | |
| digest = ctx.hexdigest() |
| from barbicanclient import client | |
| import base64 | |
| from keystoneauth1.identity import v2 | |
| from keystoneauth1 import session | |
| import os | |
| _AES_256_SIZE = 32 # bytes | |
| AES_256_KEY = os.urandom(_AES_256_SIZE) | |
| auth = v2.Password(username=os.environ['OS_USERNAME'], |
| def apply_port_exclusions(include_ports, exclude_ports): | |
| inc_ports = _reduced(include_ports) | |
| ex_low, ex_high = exclude_ports | |
| result = list() | |
| for pair in inc_ports: | |
| low, high = pair | |
| pair_range = range(low, high + 1) | |
| if high < ex_low or ex_high < low: | |
| # this pair is not excluded | |
| result.append(pair) |
| package main | |
| import ( | |
| "errors" | |
| "fmt" | |
| "time" | |
| ) | |
| func main() { | |
| startDate := time.Date(2017, 06, 21, 10, 19, 00, 0, time.UTC) |
| @app.route('/signup', methods=['GET', 'POST']) | |
| def signup(): | |
| error = None | |
| if request.method == 'POST': | |
| email = request.form['email'] | |
| password = request.form['password'] | |
| if not (email or password): | |
| return signup_error('Email Address and Password are required.') | |
| db = get_db() | |
| c = db.cursor() |
I hereby claim:
To claim this, I am signing this object: