<commit_before>= aes

An AES encrypt/decrypt gem built ontop of OpenSSL.  Not as quick as FastAES, but it doesn't require building native extensions and supports Base64 encoded input and output.

Usage:

 require 'aes'

 # Generate a random key
 key = AES.key(32)  
  => "290c3c5d812a4ba7ce33adf09598a462"

 # Encrypt something, default output is base_64 encoded.  init_vector and cipher_text are joined with "$"
 b64 = AES.encrypt(key, "A super secret message")
  => "IJjbgbv/OvPIAf4R5qAWyg==$fy0v7JwRX4kyAWflgouQlt9XGmiDKvbQMRHmQ+vy1fA="

 # Same as above but minus the base64 encoding, initialization vector and cipher_text are shoved into an array
 plain = AES.encrypt(key, "A super secret message", {:format => :plain}) #
  => [";\202\222\306\376<\206\343\023\245\312\225\214KAm", 
      "C\343\023\323U~W>\023y\217\341\201\371\352\334\311^\307\352{\020 H(DVw\3224N\223"]
 
 AES.decrypt(key, b64)
  => "A super secret message"
 
 AES.decrypt(key, plain, {:format => :plain})
  => "A super secret message" 

== Contributing to aes
 <commit_msg>I love tweaking documentation.<commit_after>= aes

An AES encrypt/decrypt gem built on top of OpenSSL.  Not as quick as FastAES but doesn't require building native extensions - also supports Base64 encoded input and output.

Usage:

 require 'aes'

 # Generate a random key
 key = AES.key(32)  
  => "290c3c5d812a4ba7ce33adf09598a462"

 # Encrypt a string.  Default output is base_64 encoded, init_vector and cipher_text are joined with "$"
 b64 = AES.encrypt(key, "A super secret message")
  => "IJjbgbv/OvPIAf4R5qAWyg==$fy0v7JwRX4kyAWflgouQlt9XGmiDKvbQMRHmQ+vy1fA="

 # Same as above but minus the base64 encoding, init_vector and cipher_text are shoved into an array
 plain = AES.encrypt(key, "A super secret message", {:format => :plain}) #
  => [";\202\222\306\376<\206\343\023\245\312\225\214KAm", 
      "C\343\023\323U~W>\023y\217\341\201\371\352\334\311^\307\352{\020 H(DVw\3224N\223"]
 
 AES.decrypt(key, b64)
  => "A super secret message"
 
 AES.decrypt(key, plain, {:format => :plain})
  => "A super secret message" 

== Contributing to aes
 
{'fraction_non_alphanumeric': 0.12321598477640343, 'fraction_numerical': 0.11512844909609896, 'mean_word_length': 4.167076167076167, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4684269', 'n_tokens_mistral': 955, 'n_tokens_neox': 757, 'n_words': 211}