4 ms·
Inpher (https://www.inpher.io/ https://www.inpher.io/) | New York (USA), Lausanne (Switzerland), Paris (France) | Software Engineers | Full-time | Onsite At In
by srosenberg 6y ago
Inpher (https://www.inpher.io/ https://www.inpher.io/) | New York (USA), Lausanne (Switzerland), Paris (France) | Software Engineers | Full-time | Onsite
At Inpher, we believe that privacy and security are foundational to the future of computing and have built enterprise products to make this vision a reality.
We are a small team of veteran founders, world-renowned cryptographers and proven software engineers.
We are headquartered in New York City, with satellite offices in San Francisco and Lausanne, Switzerland, and have raised $14M in funding.
Apply at https://www.inpher.io/careers https://www.inpher.io/careers
Or email to me directly at $user@inpher.io, where each ascii character of $user can be obtained by solving for x and converting to base-128,
x = 145767 mod 611939,
x = 109572 mod 598463
- saagarjha 6y agoUnrelated to the job post itself, but I spotted the puzzle and couldn't help but try it out for a minute. Sadly, I couldn't get anything useful out of it; I have a guess as to what it should decode to but got nothing remotely close to ASCII from it. Perhaps I'm just not smart enough to pass the test? ;)
- andrewbecker 6y agoYou're probably getting hung up on the "converting to base-128" part. Here's my solution. I wouldn't normally post it publicly, but I've emailed OP multiple times over the last couple months to apply for this position and have received no response, so maybe this is actually the best way to get around the spam filter: from z3 import * s = Solver() x = Int('x') divisor1 = x / 611939 divisor2 = x / 598463 modconstraint1 = (x - (611939 * divisor1)) == 145767 modconstraint2 = (x - (598463 * divisor2)) == 109572 s.add(modconstraint1, modconstraint2, x > 0) s.check() email_bin = '{0:b}'.format(s.model()[x].as_long()) email_b128 = [] for i in xrange(0, len(email_bin), 7): email_b128.append('0' + email_bin[i : i+7]) email_bytearr = map(lambda c: str(unichr(int(c, 2))), email_b128) print(reduce(lambda x, y: x + y, email_bytearr, '') + '@inpher.io')
- saagarjha 6y agoOh, I didn't realize that x had to simultaneously satisfy both; I just though they were two parts of the email or something. Thanks for the explanation!
- Recursing 6y agoBtw, python-z3 supports the % operator from z3 import Int, solve x = Int('x') solve([x % 611939 == 145767, x % 598463 == 109572]) [x = 243085550] Also: please use python3, it's 2020 :( And a simpler conversion to base128 would be: print(''.join(chr((x // 128**i) % 128) for i in range(3, -1, -1)))
- throwaway765e6 6y agoFor anyone wishing to try this without having to install z3, or just to see a more rudimentary way of doing this, here is a self-contained (hopefully just as readable) solution in JS: const num = findNum(); const bin = num.toString(2); const byteStrings = toChunks(bin, 7).map(chunk => chunk.join('')); const bytes = byteStrings.map(str => parseInt(str, 2)); const str = bytes.map(String.fromCharCode).join(''); console.log(num, bin, byteStrings, bytes, str); function findNum(i=0, lim=1e1000000000) { while (i < lim) { if (i % 611939 === 145767 && i % 598463 === 109572) return i; i += 1; } } function toChunks(iterable, chunkSize) { const chunks = []; for (const el of iterable) { let buf = chunks[chunks.length - 1]; if (!buf || buf.length >= chunkSize) { buf = []; chunks.push(buf); } buf.push(el); } return chunks; } 243085550 1110011111010011000011101110 [ '1110011', '1110100', '1100001', '1101110' ] [ 115, 116, 97, 110 ] <xxx> Sorry about not getting a response from the poster of the job, by the way. It's a very unhealthy attitude and it's sad to see this on HN of all places.
- throwaway235092 6y agox = 145767 while x % 598463 != 109572: x += 611939 s = '' while x: s = chr(x % 128) + s x //= 128 print(s)
- huhtenberg 6y agoGood puzzle... even if a bit trivial ;)