iss-security / hw-credit_card_crypto Goto Github PK
View Code? Open in Web Editor NEWHomework assignment for SERVSEC class to learn Ruby and basic security principles
Homework assignment for SERVSEC class to learn Ruby and basic security principles
Hi Soumya,
After taking a look at the double_trans_cipher.rb
and aes_cipher.rb
, I found it difficult to DRY out the spec/crypto_spec.rb
since the order of the arguments are not consistent with those in substitution_cipher.rb
.
double_trans_cipher.rb
module DoubleTranspositionCipher
def encrypt(key)
# implementation
end
def Decrypt()
# implementation
end
end
The only way I knew to invoke encrypt
and decrypt
is mixin (am I correct ? ).
Btw, should decrypt
in DoubleTranspositionCipher
also take a key
as parameter (for the PRNG).
aes_cipher.rb
require 'openssl'
module AesCipher
def self.encrypt(key, plaintext)
# implementation
end
def self.decrypt(key, aes_crypt)
# # implementation
end
end
This looks pretty good. However, the order of the arguments is opposite to the order in substitution_cipher.rb
which is defined as:
self.encrypt(doc, key)
# implementation
end
So, is it possible to change the method definitions?
- Cheng-Yu
Hi Professor,
In part D of the assignment, we're going to write our own test cases for the hash function.
However, something looks weird in spec/hash_spec.rb
:
it 'should produce different hashes for different information' do
# TODO: implement this test
end
This test case is designed to test that different hashes will be generated if different information is given, which is not necessary true.
As I know, there exists some hash collisions (although the probability is extremely small) that may cause failure on this test case.
So should we ignore the probability of collisions or delete this test case?
- Cheng-Yu
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.