News for hackers. Stuff that matters.

capcah

Re:Zero Knowledge Proofs: The Secret Santa Protocol on Monday November 30, 2015 @11:39AM (#10650240)
This is not a Zero Knowledge Protocol because the other party has the same information as you do.

Furthermore, this algorithm is equivalent to a DH key exchange between A and B followed by a HMAC(key,M), with the advantage that message size is not limited to the group size.

Re:Books That Shaped America on Thursday August 13, 2015 @07:07AM (#10053321)
The title should be "American Books that shaped America". The Capital not being included in that list is akin to the Catholic church leaving the Luteran bible outside a list of influential works.
Re:Why 12-Foot Traffic Lanes Are Disastrous for Safety on Friday October 10, 2014 @08:44PM (#8440784)
I see a huge number of comments on this thread implying that carefulness is related to the road danger. It's the perceived danger that matters. You don't need to make the roads more dangerous, just need to make them look so.

I'm not from USA, and on the last time I visited it, I noticed how recklessly people drive on the highways, most of them were on the phone, eating, or doing something else(there was even a lady fixing her hair with her right hand, talking on the cellphone with her left hand and holding the steering wheel with her elbow, that freaked me out).

If those people behave the same driving on a street, I can see that being the cause of the majority of accidents, since the reaction time for events will be smaller, since most occurrences happen within a few meters of the car.

Finally, I know that this is not the focus of the article, but the USA cities need to focus more on the people that either cannot or will not(like me) drive. LA, LV and Miami, for instance, were pretty hellish until I finally gave in and rented a car, with poor public transportation and pedestrian access.

Re:iPhone 6 and Android value on Thursday September 11, 2014 @12:36AM (#8300918)
I'd like to point out the writer for dismissing customisability. This is my opinion, but the popularity of some apps used to customise my phone leads me to believe I do not stand alone.

Let's not forget that the android can offer advanced functionality that Apple seems to refuse to offer on its devices: access to a local file system, ability to work as an USB stick(it's even possible to have your phone work as a boot stick), being able to turn its wireless card into monitor mode for mobile sniffing.

Last, but not least: Waterproofness and mechanical resistance. Apple seems to have forgotten these two points on the iPhone, even though they already have a good starting point(phone with no removable battery).

So, yeah, I don't think apple will win over the premium market that easily.

EDIT: Adjusting newlines, forgot that newfags can't triforce.

Re:24, the Monster, and quantum gravity on Tuesday June 03, 2014 @08:36AM (#7839714)
Just as a remark, proving that given a prime n, n^2 = 1(mod 24)[equivalent to n^2-1 is multiple of 24] is pretty easy: i) prove that n^2 = 1(mod 3). Enumerating, n = {-1,1} (mod 3) (mod 3) [since n is prime, n != 0 (mod 3)]. n^2 = 1 (mod 3) n^2 - 1 = 0 (mod 3). Exists m such that n^2-1 = 3m.

ii) prove that n^2 = 1(mod 8). Enumerating, n = {1,3,-3,-1} (mod 8) [ n != pair (mod 8) since then, it would be divisible by 2]. n^2 = {1,9,9,1} (mod 8) => n^2 = {1,8+1}(mod 8) => n^2 = 1 (mod 8). Exists k such that n^2 - 1 = k8.

iii) There exists 2 integers m,k such that k8 = m3. m must have an 8 factor and k a 3 factor. Then, there exists j such that j = m/8 = k/3 = (n^2-1)/24. qed.

Re:CloudFlare's Heartbleed challenge cracked on Friday April 11, 2014 @10:36PM (#7576745)
I am not sure how those guys did it, but I was talking to a friend of mine today, and I guess that it had something to do with forcing the server to use its private key to check for information sent to it. Then you use the heartbleed bug to intercept the intermediate forms on the information you sent to be decrypted/authenticated. Since you know the plaintext, the ciphertext and the intermediate forms, it should be possible to recover the key.

As I said, I am not sure that is right or if that was the method used to exploit cloudflare, as I didn't had the time nor the knowledge of openssl implementation to test it out, I am just throwing my guess out there before the official exploit comes about.

edit: formatting

Re:Why functional programming? on Tuesday December 24, 2013 @03:37PM (#6961047)
tl;dr: State is bad for optimizations, FP encourages you to write most of the code state-free.

One of the perks of FP is that it exposes pure functions, functions that have a fixed output for a given input. Since it's really bad at storing and mutating state(canonically can only be done via monads), it encourages you to separate your code into pure and mutable states. Let's take, for instance, a function that reads a file and xor's that with a random byte stream. A non functional approach would be something like this:

  void xor_file_stream(file input, stream random_stream){
    result = []
    file_byte = read_byte(input)
    while(file_byte != EOF){
      stream_byte = read_byte(random_stream)
      res.append(file_byte^stream_byte)
      file_byte = read_byte(input)
    }return result
  }
A possible way to write the same function using FP, using currying[1] and map[2](a fundamental construct in FP), one can write the code as this:

  byte xor(byte b1, byte b2){
    return byte(byte b2){
      return b1^b2
    }
  }
  //Here I assume the language has file and random_stream as iterables
  void xor_file_stream(file input,stream random_stream){
    return map(map(xor,random_stream),input)
  }
While, in a naive implementation, this would be much slower than the procedural implementation, there are much stronger assumptions one can make in respect to the functions while optimizing the compiler. First, the function xor is a pure function with 2^9 possible input values, and can be substituted by a precomputed lookup table, speeding up the map function. Since the function is guaranteed not to hold state, one can also unroll the map loops, or paralelize it if needed.

But remember that most "pure" FP languages are bad at keeping state, turning a huge game(for instance) into a challenge both to the programmer and to the compiler.

[1] - http://en.wikipedia.org/wiki/Currying

[2] - http://en.wikipedia.org/wiki/Map_%28higher-order_function%29

EDIT: Formmating, not used to posting to hackernews comments

Re:Ask HN: What's the best technical talk you've heard? on Monday April 08, 2013 @10:28AM (#5511848)
The talk about strange machines by Sergey Bratus.