#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    4
    Rep Power
    0

    New algo. Can this be cracked????


    If the System.key is available and plaintext + encrypted text is availabel.. Can this algo be cracked. Can we get user.key

    of any way to decode the message???



    Code:
    def encrypt(plaintext)
      begin
      k1,k2,k3 = File.read("system.key").split.map(&:to_i)
      a,b,c,d = File.read("user.key").split.map(&:to_i)
      rescue
        raise "Could not read the keys."
      end
      msg = plaintext.unpack("H*").first.to_i(16)  
      enc = []
      while msg!=0 do
        msg , x = msg.divmod(k1)
        enc.push((((a*x*x+b*x+c)%k1 + d*k2) % k3))
      end
      return enc.join(" ")
    end
    
    while (flag = gets)!=nil
      puts "The encrypted hash is: #{encrypt(flag.chomp)} (You had entered: #{(flag =~ /flag/) ? "."*(flag.size) : flag})"
    end
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    19
    Rep Power
    0

    None responds on here.


    Originally Posted by delta3
    If the System.key is available and plaintext + encrypted text is availabel.. Can this algo be cracked. Can we get user.key

    of any way to decode the message???



    Code:
    def encrypt(plaintext)
      begin
      k1,k2,k3 = File.read("system.key").split.map(&:to_i)
      a,b,c,d = File.read("user.key").split.map(&:to_i)
      rescue
        raise "Could not read the keys."
      end
      msg = plaintext.unpack("H*").first.to_i(16)  
      enc = []
      while msg!=0 do
        msg , x = msg.divmod(k1)
        enc.push((((a*x*x+b*x+c)%k1 + d*k2) % k3))
      end
      return enc.join(" ")
    end
    
    while (flag = gets)!=nil
      puts "The encrypted hash is: #{encrypt(flag.chomp)} (You had entered: #{(flag =~ /flag/) ? "."*(flag.size) : flag})"
    end
    This site sucks a bit ... You hardly get a response if you can get one.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2008
    Posts
    601
    Rep Power
    43
    Actually there are a lot of very smart people here... your question is non-sensical.

    What are the underlying mathematics behind your algorithm? Look up cryptanalysis to find out what you're in for...

    Best regards,
    AstroTux.

IMN logo majestic logo threadwatch logo seochat tools logo