Git Product home page Git Product logo

hw-credit_card_crypto's People

Contributors

cyhsutw avatar jhereztaylor avatar omarsar avatar soumyaray avatar stonegold546 avatar william-mou avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

hw-credit_card_crypto's Issues

Make the interfaces of the cryptography algorithms consistent

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

About hash collisions

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.