Skip to content

Instantly share code, notes, and snippets.

View rietta's full-sized avatar
🏠
Working from home

Frank Rietta rietta

🏠
Working from home
View GitHub Profile
@rietta
rietta / humor_troll_nsa.rb
Created April 10, 2014 20:20
Fake crytpo. It's just random data.
#!/usr/bin/env ruby
require 'securerandom'
puts "
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1
#{SecureRandom.hex(23423) }
-----END PGP MESSAGE-----
"
@rietta
rietta / bytes.rb
Created August 12, 2014 01:47
Quick and dirty command line tool to covert bytes to nibbles, kilobytes, megabytes, gigabytes, and terabytes.
#!/usr/bin/env ruby
##
# bytes
# Quick and dirty way to get a slate of byte conversions from the command line.
# Put it in your path and make it executable, by 'chmod 755 bytes'.
#
# Author: Frank Rietta
##
@rietta
rietta / keybase.md
Created January 8, 2015 04:39
Confirming for keybase

Keybase proof

I hereby claim:

  • I am rietta on github.
  • I am rietta (https://keybase.io/rietta) on keybase.
  • I have a public key whose fingerprint is EF65 AC38 A698 E87D 9CEF B60F 658C D5E9 C004 BAE3

To claim this, I am signing this object:

Regular talks are 45-minute blocks. We recommend 30-35 minutes of presentation, followed by allowing 10-15 minutes for questions and discussion.

Title

Defending from Data Breaches by Fostering a Culture of Security

Tracks: Culture or Crafting Code

Abstract (600 chars)

You've been hearing about big data breaches in the news. As a developer who doesn't specialize in security, knowing how to protect your application from getting hacked may seem like a daunting task. However, fundamentals in the design and development process will greatly increase the security that protects your users from harm.

For Review Committee

@rietta
rietta / sql_views.rake
Created March 6, 2015 21:00
SQL Views rake task implementing `rake db:views`
namespace :db do
desc "Update and create SQL views"
task :views => :environment do
Dir["#{Rails.root}/db/sql_views/*.sql"].each do |file_name|
STDERR.puts "Applying the SQL view at #{file_name}"
source_file = File.new(file_name, 'r')
if source_file and (sql_content = source_file.read)
ActiveRecord::Base.transaction do
# Each statement ends with a semicolon followed by a newline.
@rietta
rietta / superpolynomial.txt
Last active November 14, 2022 01:18
Memorize the RSA encryption algorithm as a song! This is a mirrored copy of the RSA, Superpolynomial song which has become hard to find on the Internet.
These original sources are now no longer available:
- http://www.xent.com/FoRK-archive/oct00/0429.html
- http://www.cryptorights.org/events/2000/superpolynomial.html
For a 2000 example of how to use this song in a lecture format, see http://permalink.gmane.org/gmane.comp.encryption.general/4856 by Eric Hughes.
To the tune of Mary Poppins:
Superpolynomial subexponential runtimes.
Even though in practice it would take you several lifetimes,
@rietta
rietta / hello_world_encrypt.sql
Last active January 12, 2016 04:31
Encrypts a hello world greeting to my personal public PGP key that's published at https://keybase.io/rietta.
SELECT
ARMOR(PGP_PUB_ENCRYPT(
'Hello, World',
DEARMOR('-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBFPRvdYBEACeM7pbpqxheVpIkfNSt1I//MLMmmvV/2XlJFj0z4zTOZPU5KTl
DNpfV0bHSUU5pOs9hSkM5WP+uWTAl/X5a5Ty7Vdr0r//sYNYt05ummAZQEwfaSzj
Ys57Ks1yC/31SOM/bOvWOIf/+D/GVAEuJTdfwic/Vv56ixuk8skLjWTmxBBCFpbF
dEXWyxuADvftrhaGq16xaOx0vLFxagL7mpIEjVN2yYadR5iMm1g48lAG6Tc/JEPY

The anticipated Feinstein-Burr Compliance with Court Orders Act, an anti-security bill, would require the provision of data in an intelligible format to a government pursuant to a court order (scribd.com). A draft copy has appeared online though whether it has been submitted officially within the Senate is not yet clear (vice.com).

This bill essentially says you can not have any conversation or data exchange that the government can not access if it wants to. It is the legal culmination of what the FBI has been lobbying Congress for years. If Feinstein-Burr becomes law, it will be illegal to deploy strong encryption without key escrow maintained by each company. Cryptographers and computer scientists near-unanimously assert key backup systems are insecure at scale.

@rietta
rietta / hours.rb
Created September 12, 2016 19:45
Command line tool to convert hours into decimal notation suitable for invoices. 2:50 = 2.8 hours, etc.
#!/usr/bin/env ruby
##
# Convert hours to invoice time, which is rounded to 6 minute increments.
time_value = ARGV.last.to_s.strip
if time_value =~ /\A[0-9]*:[0-9]*\Z/
time_elements = time_value.split(':')
minutes = time_elements.first.to_i * 60.0 + 1.0 * time_elements.last.to_f
elsif time_value.to_f > 0.0
minutes = time_value.to_f * 60.0
describe "User can't change the ID" do
login_as user
get :show, id: other_account.id
expect(response).to have_http_status :unauthorized
expect(response.body).to_not include other_account.id
end