« first day (429 days earlier)      last day (4524 days later) » 

6:00 PM
@Xaade It's called "I am Bob", sorry.
I fully agree that the interface could be a lot simpler...
What I will do is add random number generation so that you don't have to make up your own secret. Mainly because the secret is really only safe if it is quite long.
 
@KerrekSB So it's safer to exchange your whole diary? ;P
 
I guess what isn't clear is that steps 1, 2 and 6 are Alice's and 2-5 are Bob's.
 
This is what I ended up with
öZ¸ïK
 
@Maxpm The entire scheme isn't safe for prolonged use because of the very simple line encoding. I'd say it's only safe for a handful or so of messages.
 
so wait... the secret input boxes aren't really secret.... they're just algorithm keys?
 
6:03 PM
@Xaade Hm, our shared secret isn't correct, actually
 
Once everything is filled in, then we pass back and forth info?
 
Let's try again. Here's my g^a:
45261896188683411480815185450757449660489125564865201577784356208753773549609126463383022325516960567530038446342159857573561333488161194590757383454389416187793136232554844099338083395239812464160734193763345156568765881457225181379125121626475979974486594654991336641005888050079628223157926328479207240883
 
1034638710064370325 shared
 
@Xaade Yes, once we both have the same shared secret, we can use it as a symmetric cipher
@Xaade You have to tell me your g^b
 
3349900279062513947874176920861972463321385210344678486358371477684592666338407557982894059836817865971347968268881115831627147858123944548948242608235284005872770603724941037979395190207074696383371991081097906328184712581621263198725333056680303927547927408043469033554430641075850187682799201799988366867
 
6:05 PM
Can you paste it with four spaces at the front?
 
Then, you could just use random numbers for secret a and b. That's what confused me. I didn't know what those fields were for.
 
@Xaade Right. At the moment you have to type them in
The offline app has a RNG for that
But I haven't updated the web version yet
 
Who made this?
 
OK, message:
4490285527544566919573065486007928645152348919322485111475819259353065425372612068420020231520541996854900587217390699950779347954854151762685407877655515530531362877145000254587367846939353171869776553928792760997209962984471169268837013954
@Xaade I stole the bignum library from the web
The website is mine
 
OMG.... all that work....
I don't get it, if someone sees Ga, and Gb, and shared, why can't they have our data?
 
6:08 PM
@Xaade One night :-)
 
Is the g and p randomized?
 
@Xaade Nobody sees our shared secret. That's why it's called a "secret".
@Xaade No! They're very carefully chosen parameters.
 
so I'm not supposed to post shared....
geez
 
@Xaade I thought the numerous admonitions "secret" would give it away...
 
Step 5. implies I'm supposed to give you shared secret
 
6:09 PM
@Xaade Originally I wanted to make those configurable, too, but that's probably not a good idea at all. There should be a collection of Good Parameters, though, I suppose.
 
Are the messages/secrets/skeletons/whatever numeric-only?
 
@Xaade Step 5 says "send g^b to Alice".
g^b is what gets pasted into the "output" field when you press "I'm Bob"
 
@Maxpm "secrets" are, messages are text as far as I can tell
 
@Maxpm I devised a very simple line code for that
@Xaade Have you deciphered my message yet?
 
How does one devise something simple?
 
6:11 PM
If you are Bob: Wait for the data from Alice, read it, and enter a secret b. Then send gb to Bob and compute the shared secret. [button: 4. I am bob, make shared secret] 5. Send to Alice.
 
@Maxpm Just look at the source, Luke. It's an embarrassingly silly XOR scheme
 
@KerrekSB You said, "Hello [fucking] world"
 
@Xaade Haha -- you're just guessing!
Or are you? ;-)
 
@KerrekSB No, it actually said, Hello World.
That's what I got.
After all that bullshit, I wouldn't lie.
1 min ago, by Xaade
If you are Bob: Wait for the data from Alice, read it, and enter a secret b. Then send gb to Bob and compute the shared secret. [button: 4. I am bob, make shared secret] 5. Send to Alice.
 
@Xaade Yes, well done, Deep Throat
 
6:13 PM
I think it should say, Then send gb to Alice and compute the shared secret
 
Now that you understand the scheme, would you like to build a better interface?
@Xaade Yes yes. The interface is terribly confusing at the moment
I guess it was supposed to mean "send whatever is in this text box to Alice"
 
Yeah, whenever I type something other than a number into a, g^a is just 1.
 
@Maxpm Of course. It'll be parsed as 0, and g^0 is 1
 
Of course.
 
@KerrekSB Yeah, hide g and p and secrets a and b. Randomize secrets a and b. Then, put all the steps on buttons, a box before button [optional] for input, a box after button [optional] for output. Then put leave encrypt and decrypt as is.
 
6:15 PM
I guess you can at least check visually if you picked a good secret. I think it's also possible to pick some nontrivial numbers for which g^a is 1 (DeadMG kept finding those). So you basically have to pick a "good" secret before you send it off.
@Xaade Yes
Maybe with one more manual step of generating the secret or so...
the BigInt.js thing actually does come with an RNG
I hate interface design, especially in HTML/JS
The offline app is written in Qt, that's not half bad
 
What's a good versus bad secret?
 
@Xaade So, if g^a is 1, then that's bad
 
@KerrekSB RNG shouldn't output a result that leads to 1
 
Actually, that isn't supposed to happen a lot
@Xaade yeah
 
@KerrekSB can't the page check RNG secret for 1 and try again?
 
6:18 PM
@Xaade Sure.
Someone would have to write that :-)
 
Someone want to try it with me? Trying to work it out on my own is giving me a headache.
 
I'll add a "make random" button, though
@Maxpm Try what?
 
@Maxpm You can't solo this.... the inputs are all wierd.
 
@Xaade You can have two tabs ;-)
 
@KerrekSB don't....
Just hide all of g,p, a, and b
 
6:19 PM
@KerrekSB The secret sexchange.
 
@Xaade That's quick and easy, like my niece.
 
Only display ga and gb, but in a read-only box.
 
@Maxpm Sure. You're alice. Go.
@Xaade Yes yes. All good ideas.
 
@KerrekSB g^a is 4834036316297980154140164328411310793750137605863081696107999267979143473509094‌​360794542793807682829463364949892758250738251843174589695699647898137837997626457‌​417496730085184972687790732776714252296682428355863582080404596550040341942663618‌​9092507820023991137998086897570085247693481918274257089235240560905.
 
Paste it into a separate code box -- that's easier to copy
I.e. four spaces
 
6:20 PM
48340363162979801541401643284113107937501376058630816961079992679791434735090943607945427938076828294633649498927582507382518431745896956996478981378379976264574174967300851849726877907327767142522966824283558635820804045965500403419426636189092507820023991137998086897570085247693481918274257089235240560905
 
I feel sometimes, bad UI like this is derived from doing something on pen and paper with a calculator. Then putting all the numbers into boxes in the same order that person wrote things down.
 
My token:
And a message:
3956781204621716054038628968837835546840404952243494387433565910836970710263760393702727338063491862848138808053196020544189352578838129783696662119689936528528417637596377456155316407847056407957824803561642615188419391934990826381186001938
38888925976396468170780402617155149431541222035549332450798046715798137676131760576301601251143525958973600506383448442429730002284848199639035986312239970171097059976303315657320557204745486587013407262933361922080923363972828709162135273883353992968864827678772237827560157037091994327029574060769736891010
 
ffs who gives a sh*t about a random series of numbers?
 
OK, now what do we do with the shared secret?
 
@Xaade Sure. Or rather, the UI derives from someone who's only concerned about the implementation of the cipher, not the usability.
@Maxpm Keep it to yourself!
Just leave it in the box, as it is. Now it's time to move to the lower half of the page entitled "Talk"
 
6:23 PM
Ooookay.
 
Paste my message into "Encrypted" and hit "decrypt"
 
@KerrekSB Nothing visibly happens when I hit decrypt.
 
@Maxpm The concept is that you should both end up with the same shared secret, and ga should be a derivative of g and a, and gb should be a derivative of pb. G is on your screen, and P on his. So the shared secret is a derivative of half yours and half his, yours is a mesh of two secrets, his is as well.
 
@Maxpm Did you paste this long number I sent into the "encrypted" box?
 
@KerrekSB Yes. Maybe I mis-copied it. One moment.
 
6:25 PM
So unless someone knows your g, and his p, they can't use ga, and gb, to get the same shared secret.
 
@Xaade Hm. g and p are publicly known constants
a and b are true secrets
g^a and g^b are public, and g^ab is the shared secret
 
@KerrekSB I should be pasting your number beginning with 3888, correct?
 
@Maxpm No, that's my token.
 
@KerrekSB I see..... now.... that's where I have a problem. You just broadcasted ga and gb. Someone else can just type those in and get the same shared.
 
I.e. g^b. You should paste the token into "input" and press (6)
THEN proceed to paste my message (395...) into "encrypted"
@Xaade No.
@Xaade If you intercept my g^a, you don't know Bob's b.
 
6:27 PM
@KerrekSB That's the confusing part. How to use the input. Hence why I suggested a separate input for every instruction.
 
and if you intercept Bob's g^b, you don't know my a
so you cannot compute g^ab
@Xaade Yes. I don't dispute that the interface can be improved hugely
 
@KerrekSB so with ga and gb, and at least a or b, I can make the shared secret.
ga and gb are public.
 
@Xaade Yes
 
I only need a OR b
 
Which (again) is why a and b are called... "secrets" :-)
 
6:29 PM
@KerrekSB Okay, I think I got it.
 
@KerrekSB I didn't realize you could make the same shared with a or b.
 
@Xaade Well, both parties have to be able to make the shared secret, non?
@Maxpm Did you get a readable message?
 
@KerrekSB I did.
 
@KerrekSB french!
 
@Xaade Haw haw!
 
6:30 PM
@Maxpm Now send one back!
 
C'est NON!
 
@KerrekSB Encrypt something with Talk?
 
@Maxpm Yep
 
4008246615963013493511162718348107223580339677468209506752416499245806275484151214476405716539326288722175855808068393750069249571366643837365684102883806844371303609657307676556317607155578982843799197290459325997050526914317996225114019689
 
@Xaade There's nothing in English quite like "non?", non?
 
6:31 PM
Mais, oui.
 
3566461966235187244396192967771455254053564051371060452002887275435761337312658918018384677919496398282130925153655759966821694637499421286575039746924190589160726190751511137568875398509679316913763896472679482644595409836084637848874413841
@Maxpm Short and punchy
In a crunch, you could publish your g^a, and everyone who wanted could drop you a secret message by sending you a pair consisting of g^b and their message
 
So these encrypted public messages we're tossing back and forth use the shared secret?
 
That way you can allow people to talk to you offline without risking exposure
@Maxpm Yes
Back in the day, Xeo and I used to compare shared secrets by comparing their MD5, to make sure we had the same one
 
3585794768117479351590665397949827277319463497474251428311716247719069783610188346459626532648227299112819351768702447011698819505486028901536472484515024325654754799116284303247715219220548736745952498621893414494869738671343574406705145368
 
But since we're evidently able to understand each other, we know we got the right one
 
6:34 PM
@KerrekSB Clever.
 
@Maxpm So the offline app actually displays the MD5 of the shared secret, because Qt has an implementation of it. For the Javascript version I couldn't be bothered.
In a crunch, I'd just echo -n xxx | md5sum.
 
Qt has an MD5 implementation? Why?
 
@Maxpm Because there's nothing it doesn't have!
 
@Maxpm You've got to have your own md5 implementation!
 
Is Qt the one with its own string class?
 
6:36 PM
@jalf I honestly couldn' t care less.
 
@Maxpm yes
 
@Maxpm It has many, many string classes!
As well as Quint's
 
Of course.
 
The source code is on the git repository
 
Now I remember why KDE is a bloated piece of junk.
 
6:37 PM
@Maxpm At least it's hashable...
 
@Maxpm What do you mean, why? Does it need a reason?
 
I originally wrote the offline app because the first JS bignum library I was recommended was an unmitigated disaster.
Now I found this new one which is very fast, so the website is usable.
 
@Maxpm fun fact, .NET has two MD5 implementations, and one of them is buggy. :)
 
@jalf It's always better to have a choice!
 
that's the easy-to-find one btw
 
6:38 PM
@jalf Buggy how? That doesn't sound very good.
 
What's the correct one called?
 
they have a second one hidden away in some obscure class I can't remember the name of, which actually works correctly
 
__CorrectMD5Sum_ex()?
 
@Maxpm can't remember exactly. A coworker discovered it a year or two ago. There were some corner cases where the buggy one failed, but for most inputs it was ok
google should turn up a few references though. It's a known problem
 
The buggy one failed on email addresses
 
is size_t(-1) +1 defined to be 0? I know size_t(-1) is guaranteed to be the maximum representable value of size_t.
dang, I guess not...
 
@rubenvb I'm pretty sure that kind of overflow is undefined.
 
@Maxpm I think size_t is guaranteed to be an unsigned type
And for those, -1 is the largest value, and wraparound is defined.
 
@KerrekSB Really? Huh.
Man, undefined behavior can be such a pain.
 
size_t(-1) is fine, that's how string::npos is defined btw
21.4/5 in the C++11 FDIS has that literally.
 
7:02 PM
I absent-mindedly put my laptop charger in my mouth. I think it gave my tongue a good zap.
 
@Maxpm Unsigned integer arithmetic isn't UB. It's very nice and straight-forward.
(By that I mean it's never UB, by contrast to signed arithmetic, whose well-definition depends on the values.)
 
great, @anonymous_downvoter at it again: stackoverflow.com/a/3318010/256138
 
7:23 PM
Hello everyone !
kinda need help here :(
got an C++ app that suppose to send cookies
but it's not working
-4
Q: C++ Program that Sends an HTTP Post-request (html example)

BuxmeI want to code a program that Would send an HTTP Post request. The only problem is that it's really hard for me to learn with no examples :(. So here is the example : Well suppose I have a site that looks like this: <html> <body> <form action="index.php?id=log2" metho...

 
good morning
 
morning baby
what's up?
 
feeling less sick now
 
Secrets Exchange now with random secret suggestions
 
sigh
 
Xeo
7:35 PM
I just noticed that for developing my hobby project game, I don't need any grafics. I can just output everything to the console, as it's purely 2D
 
@Xeo ASCIIQuake?
 
I did 3d rendering with console once
it was hard to tell what was going on
 
@Pubby Nethack, eh?
 
Nethack is 3d?
 
I just recently learned that Nethack saves its state by only saving the RNG seed and the sequence of user actions.
@Pubby Sure, it got width and height and tons and tons of depth
 
7:41 PM
that's how many games do it
 
Over 20 levels
Multi-faceted characters.
 
the problem comes with how long it takes the CPU to re-simulate the game
 
this is what I'm talking about:
 
of course, a game like Nethack would hardly have any problem with that
 
How do the save state games do it?
Do they just save the memory
 
7:43 PM
@DeadMG Not terribly long apparently
 
I can't imagine saving user actions in a game like skyrim.
 
you only have to save the relevant actions
for example, if you walked in a circle for hours, the game doesn't care about that
 
@DeadMG Like what happened since you loaded.
 
yes
 
Or since you last entered combat.
Or within reach of an enemy?
 
7:44 PM
more than that
it's only meaningful interactions
the game can just say "Travelled to X location, took Y in-game time." to account for all movement, for example
 
A guess would be, save location, save inventory, save world state. Then save actions since being within range of an enemy (like when you can't wait because you're too close to an enemy)
 
@rubenvb (size_t(-1) + 1) == 0. Why wouldn't it?
 
@Pubby because my compiler said it wasn't... hold on, rechecking.
 
Of course Skyrim also has the complexity of radiant AI, which means that a third party could be acting in simulation within the world simultaneously.... however, I suppose you don't have to save that, you just have to save what they started. You can RNG the completion after every load if you need to.
 
@Pubby hot damn. Must've typoed somewhere.
It was my first thought though, starting at -1.
luckily, I've copied the original code into the question
 
7:49 PM
Like, you enter a cave, free a guy, he attempts to return home, and you enter another cave. It takes the NPC 1 day to travel, and he has a chance to encounter an enemy. His survival could simply be RNGed. If the day hasn't finished when you save game, the game only needs to save his attempt, not the result. It can calc the result at the end of the day.
However, I've had things happen like, let a guy go. Do something, get on horse, travel, and stumble into him running back home.
So I guess it saves progress too.
 
@rubenvb You're trying to split the string, right? Did you read this: stackoverflow.com/questions/236129/how-to-split-a-string-in-c ?
 
@Pubby oh yes, stringstream is overkill for this
And I'd have to use some form of getline to get a custom delimiter
 
do references extend lifetime of temporaries, or only const references?
 
Ugh, I'll never answer a PHP question again -- random downvotes from people who don't accept "possible suggestion depending on your needs" because it doesn't cover what they want...
 
@Pubby Temporaries can only bind to const references
 
8:02 PM
oh right, rvalues
 
I wish someone would upvote me for that...
3
 
@rubenvb For what? Link?
 
3 mins ago, by rubenvb
@Pubby Temporaries can only bind to const references
 
You can have a star :-)
 
Yay for me!
 
Xeo
8:05 PM
@rubenvb Wrong.
 
eh
they can also bind to rvalue references
 
oh yeah
downvote time
 
Xeo
MyClass&& rr = MyClass(); // temporary bound to rvalue ref, extended lifetime
 
@Pubby Unstarred!
@Xeo Though is is fairly arcane
 
what's the use of rvalue references like that?
 
8:06 PM
Restarred.
 
Xeo
@Pubby Better implementation of scope guards
 
usually, you see it like auto&& rr = function();
 
@Pubby To bind to rvalues
 
@DeadMG in my defence, I was talking about "single" references &
 
@rubenvb An rvalue reference is a single reference.
as it is one reference
 
8:06 PM
why would you want a non-const scope guard?
 
Xeo
@Pubby So you don't need mutable members in it?
 
@rubenvb So the more correct statement is, "Some things cannot bind to rvalues."
 
@DeadMG then what's the differnce between int& i and int&& i?
 
@rubenvb One binds to lvalues, and the other binds to rvalues.
but they are both just one reference
 
Xeo
guard const& g(bla()); // can only call const functions
 
8:07 PM
ugh
 
oh, that makes sense
 
what, did you think an int&& was a reference to a reference or something?
 
no, I though it was an rvalue reference, as opposed to "the other/old reference"
 
no
it's just "rvalue reference" and "lvalue reference"
 
rvalue does not have identity.
rvalue reference allows you to hold a reference to something that doesn't have identity.
 
8:11 PM
@DeadMG well, it's what I thought anyways :)
 
Xeo
I wonder what promted the comittee to decide that a named rvalue reference is an lvalue
int&& i = 5;
int& ii = i; // valid
 
the fact that otherwise is horrifically broken?
 
like.... return A();
 
?? why wouldn't it be a lvalue
 
std::string&& s = std::string();
func(s); func(s); // GOT MOVED TWICE! owch!
 
8:15 PM
how does it get moved twice?
 
@Pubby because, in the statement return A(), A() doesn't have an identity.
 
it would get moved twice if a named rvalue reference was an rvalue
 
A a; // has identity -> lvalue
A(); // doesn't have identity -> rvalue.
 
is identity an actual term?
 
8:17 PM
@Pubby yes
identity is a name.... a way to reference the thing.
 
again?
some one ban this fuck
 
A a; // a is identity
 
int& foo(); has no identity, but is lvalue???
 
yeah it does.
int& foo() { int something = 5; return something; } // something is identity, temporary lvalue
 
@DeadMG He got banned for two weeks or so and I think lost all his rep, but he's got some back - god knows what for. Probably all "accept" rep?
 
8:19 PM
lol
 
Damnit, who upvotes this crap (edited)?
 
5 // no identity, no move
return new A() // no identity
return A() // no identity
A* a = new A(); return a; // identity
A a; // identity
int a = 5; // identity
 
It makes no sense why he can still post questions, when people like this are getting perma-banned:
 
What's his "offense"?
 
perl.j's? I dunno, he just isn't allowed to ask anymore
 
8:25 PM
Hm. I guess there must have been a reason...
Is he just banned from the chat, or also from posting?
 
Just posting questions on SO
he had a thread about it on meta, but it got closed
think I'll start a new one. These auto bans make no sense
 
8:44 PM
0
A: Find the element with the longest distance in a given array where each element appears twice?

XaadeTake first number, divide by 2nd, if the result divides you have distance, if not multiply by second number. Store greatest distance in first cell, running total in second cell, the greatest distance number in third cell. Don't store greatest number until you're past the third cell. You know the...

 

« first day (429 days earlier)      last day (4524 days later) »