havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.5, 2.5.7, 2.7.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
Swyper has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 265 seconds]
AJA4351 is now known as AJA4350
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
shirak has quit [Ping timeout: 240 seconds]
millerti has quit [Read error: Connection reset by peer]
RiPuk has quit [Read error: Connection reset by peer]
RiPuk has joined #ruby
davidw has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
LaChiave has joined #ruby
olblak has quit [*.net *.split]
VSpike has quit [*.net *.split]
jerme_ has quit [*.net *.split]
ablackack has quit [*.net *.split]
VSpike has joined #ruby
olblak has joined #ruby
ablackack has joined #ruby
jerme_ has joined #ruby
jaequery has joined #ruby
d^sh has quit [Ping timeout: 240 seconds]
d^sh has joined #ruby
davidw has joined #ruby
davidw is now known as Guest49283
teclator has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
olblak has quit [*.net *.split]
VSpike has quit [*.net *.split]
jerme_ has quit [*.net *.split]
ablackack has quit [*.net *.split]
laylaxh has quit [Remote host closed the connection]
jenrzzz has joined #ruby
olblak has joined #ruby
jerme_ has joined #ruby
ablackack has joined #ruby
VSpike has joined #ruby
teclator has joined #ruby
troulouliou_dev has joined #ruby
drincruz has joined #ruby
psilly0 has quit [Quit: psilly0]
howdoi has quit [Quit: Connection closed for inactivity]
Nicmavr has quit [Read error: Connection reset by peer]
AJA4351 has joined #ruby
Nicmavr has joined #ruby
AJA4350 has quit [Ping timeout: 265 seconds]
AJA4351 is now known as AJA4350
Guest49283 has quit [Ping timeout: 265 seconds]
AJA4350 has quit [Quit: AJA4350]
bsdband93 has joined #ruby
bsdbandit-01 has quit [Ping timeout: 265 seconds]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
shirak has joined #ruby
olblak has quit [*.net *.split]
VSpike has quit [*.net *.split]
jerme_ has quit [*.net *.split]
ablackack has quit [*.net *.split]
bambanx has joined #ruby
teclator has quit [Ping timeout: 268 seconds]
olblak has joined #ruby
VSpike has joined #ruby
jerme_ has joined #ruby
ablackack has joined #ruby
dbugger has quit [Quit: Leaving]
drincruz has quit [Ping timeout: 268 seconds]
Esa_ has quit []
bsdbandit-01 has joined #ruby
teclator has joined #ruby
bsdband93 has quit [Ping timeout: 265 seconds]
Fusl has quit [Max SendQ exceeded]
drincruz has joined #ruby
shirak has quit [Ping timeout: 240 seconds]
Fusl has joined #ruby
kyrylo has joined #ruby
LaChiave has quit [Quit: Bye Bye]
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz_ has quit [Ping timeout: 265 seconds]
chalkmonster has quit [Ping timeout: 252 seconds]
chalkmonster has joined #ruby
cloaked1 has joined #ruby
cloaked1 has quit [Changing host]
cloaked1 has joined #ruby
drincruz has quit [Ping timeout: 240 seconds]
ravenousmoose has joined #ruby
teardown has quit [Ping timeout: 276 seconds]
olblak has quit [*.net *.split]
VSpike has quit [*.net *.split]
jerme_ has quit [*.net *.split]
ablackack has quit [*.net *.split]
ravenousmoose has quit [Ping timeout: 252 seconds]
teclator has quit [Ping timeout: 240 seconds]
ablackack has joined #ruby
VSpike has joined #ruby
jerme_ has joined #ruby
olblak has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
wildtrees has quit [Quit: Leaving]
chalkmonster has quit [Quit: WeeChat 2.6]
teclator has joined #ruby
gix has quit [Ping timeout: 268 seconds]
Swyper has quit [Remote host closed the connection]
evdubs has quit [Quit: Leaving]
lalitmee has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
teardown has joined #ruby
jenrzzz has joined #ruby
evdubs has joined #ruby
RiPuk_ has joined #ruby
quazimodo has quit [Read error: Connection reset by peer]
RiPuk has quit [Ping timeout: 240 seconds]
quazimodo has joined #ruby
sphex has quit [Remote host closed the connection]
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brool has quit [Ping timeout: 276 seconds]
Swyper has joined #ruby
cd has quit [Quit: cd]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
Swyper has quit [Ping timeout: 276 seconds]
ur5us has quit [Ping timeout: 265 seconds]
IGnorAND has quit [Ping timeout: 265 seconds]
dr_mdma_md has joined #ruby
jackjackffm has joined #ruby
IGnorAND has joined #ruby
jackjackffm has quit [Client Quit]
bacchist has quit [Read error: Connection reset by peer]
bacchist has joined #ruby
ur5us has joined #ruby
Inline has quit [Quit: Leaving]
cloaked1 has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
ur5us has quit []
olblak has quit [*.net *.split]
VSpike has quit [*.net *.split]
jerme_ has quit [*.net *.split]
ablackack has quit [*.net *.split]
olblak has joined #ruby
jerme_ has joined #ruby
ablackack has joined #ruby
VSpike has joined #ruby
Intelo has joined #ruby
sphex has joined #ruby
Intelo has quit [Ping timeout: 240 seconds]
bambanx has quit [Quit: Leaving]
duderonomy has joined #ruby
conta has joined #ruby
schne1der has joined #ruby
Nanuq has quit [Ping timeout: 250 seconds]
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
lalitmee has quit [Remote host closed the connection]
xco has joined #ruby
DTZUZO has quit [Ping timeout: 245 seconds]
schne1der has quit [Ping timeout: 240 seconds]
_whitelogger has joined #ruby
dellavg has joined #ruby
go|dfish has quit [Ping timeout: 250 seconds]
andikr has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
Axy has quit [Ping timeout: 268 seconds]
go|dfish has joined #ruby
dionysus69 has joined #ruby
andikr has quit [Ping timeout: 276 seconds]
andikr has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
gix has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
sandstrom has joined #ruby
gix has quit [Ping timeout: 250 seconds]
ellcs has joined #ruby
DTZUZO has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
Mia has quit [Ping timeout: 264 seconds]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
Axy has quit [Ping timeout: 276 seconds]
sphex has quit [Quit: leaving]
sphex has joined #ruby
DTZUZO has quit [Ping timeout: 268 seconds]
_mak_ has quit [Ping timeout: 250 seconds]
hagebake has quit [Ping timeout: 268 seconds]
ellcs has quit [Ping timeout: 268 seconds]
TomyWork has joined #ruby
DTZUZO has joined #ruby
akemhp has joined #ruby
cgfbee has quit [Ping timeout: 240 seconds]
DTZUZO has quit [Ping timeout: 268 seconds]
DTZUZO has joined #ruby
Intelo has joined #ruby
cgfbee has joined #ruby
DTZUZO has quit [Remote host closed the connection]
DTZUZO has joined #ruby
DTZUZO has quit [Ping timeout: 268 seconds]
schne1der has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
DTZUZO has joined #ruby
akemhp has quit [Ping timeout: 240 seconds]
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #ruby
mikecmpbll has joined #ruby
sandstrom has joined #ruby
phaul_ has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hagabaka has joined #ruby
_mak has joined #ruby
phaul_ has quit [Ping timeout: 268 seconds]
jacksop has joined #ruby
bitwinery has quit [Quit: Leaving]
ellcs has joined #ruby
phaul_ has joined #ruby
bsdbandit-01 has quit [Ping timeout: 240 seconds]
KeyJoo has joined #ruby
Axy has joined #ruby
Mia has quit [Ping timeout: 276 seconds]
guardian has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: inabit. zz.]
mikecmpbll has joined #ruby
cisco has joined #ruby
cisco is now known as Guest38534
phaul_ has quit [Ping timeout: 240 seconds]
KeyJoo has quit [Quit: KeyJoo]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest38534 has quit [Ping timeout: 240 seconds]
LaChiave has joined #ruby
xco has joined #ruby
cisco_ has joined #ruby
jacksop has quit [Remote host closed the connection]
phaul_ has joined #ruby
sevvie has quit [Ping timeout: 268 seconds]
sevvie has joined #ruby
Mia has joined #ruby
guardian has joined #ruby
Axy has quit [Ping timeout: 252 seconds]
jacksop has joined #ruby
cisco_ has quit [Ping timeout: 240 seconds]
fanta1 has joined #ruby
jacksop has quit [Remote host closed the connection]
dbugger has joined #ruby
dr_mdma_md has quit []
jacksop has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
mikecmpbll has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tpanarch1st has joined #ruby
jacksoow has quit [Ping timeout: 265 seconds]
Swyper has joined #ruby
jacksoow has joined #ruby
Swyper has quit [Ping timeout: 268 seconds]
jacksop has quit [Remote host closed the connection]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has joined #ruby
jacksop has joined #ruby
cisco has joined #ruby
cisco is now known as Guest72987
loveablelobster has joined #ruby
spacesuitdiver has joined #ruby
hagabaka has quit [Ping timeout: 265 seconds]
_mak has quit [Ping timeout: 276 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
LaChiave has quit [Quit: Bye Bye]
hagabaka has joined #ruby
_mak has joined #ruby
AJA4350 has joined #ruby
stryek has joined #ruby
xco has joined #ruby
Swyper has quit [Ping timeout: 264 seconds]
teclator has quit [Ping timeout: 265 seconds]
phaul_ has quit [Ping timeout: 240 seconds]
teclator has joined #ruby
drincruz has joined #ruby
Swyper has joined #ruby
howdoi has joined #ruby
jacksoow has quit [Read error: Connection reset by peer]
jacksoow has joined #ruby
RiPuk_ has quit [Remote host closed the connection]
RiPuk has joined #ruby
tsrt^ has quit []
cd has joined #ruby
phaul_ has joined #ruby
drincruz has quit [Ping timeout: 268 seconds]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jacksop has quit []
phaul_ has quit [Ping timeout: 240 seconds]
schne1der has quit [Ping timeout: 240 seconds]
lucasb has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
rapha has joined #ruby
<rapha> hi
<rapha> is it possible that it's a *really* bad idea to nest begin-rescue-end blocks?
schne1der has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
kyrylo has joined #ruby
drincruz_ has joined #ruby
xco has joined #ruby
sandstrom has quit [Ping timeout: 246 seconds]
drincruz_ has quit [Ping timeout: 268 seconds]
teclator has quit [Ping timeout: 250 seconds]
teclator has joined #ruby
sandstrom has joined #ruby
phaul_ has joined #ruby
phaul_ has quit [Ping timeout: 265 seconds]
suukim has joined #ruby
<adam12> rapha: What's your use case? or rather, what are you trying to do at a higher level? can you show some code?
<adam12> rapha: Nested begin/rescue blocks aren't inheritently bad. Almost every Rails app is likely doing it without even knowing it. But you can specify multiple exceptions and rescue multiple times, and blocks (in 2.6) and method definitions (2.4?) are implicit begin/end blocks so you can rescue in there and drop a nesting.
<rapha> adam12: i already rewrote it, so this is just me wanting to talk about best practices. the problem seems to have been that the inner block's rescue branches were never reached, only the outer block's rescue branches.
<adam12> rapha: Hard to say without code.
schne1der has quit [Ping timeout: 252 seconds]
AJA4351 has joined #ruby
<rapha> hmm okay. it's good to know that it's not necessarily bad. that means i just did something wrong. next time around i'll try to be more mindful of it.
DTZUZO has quit [Ping timeout: 265 seconds]
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4351 is now known as AJA4350
drincruz_ has joined #ruby
Guest72987 has quit [Ping timeout: 268 seconds]
Swyper has joined #ruby
loveablelobster has quit [Quit: Textual IRC Client: www.textualapp.com]
teclator has quit [Ping timeout: 265 seconds]
DTZUZO has joined #ruby
Swyper has left #ruby [#ruby]
Swyper has joined #ruby
<Swyper> hi
<Swyper> so I want to see if an object with a particular attribute exists in an array of objects
<Swyper> any ideas for what methods to use? I was thinking include but I don't think that would wok
<Swyper> work
<Swyper> pls ping when reply
DTZUZO has quit [Ping timeout: 268 seconds]
phaul_ has joined #ruby
DTZUZO has joined #ruby
tsujp has quit [Quit: Textual IRC Client: www.textualapp.com]
tsujp has joined #ruby
teclator has joined #ruby
phaul_ has quit [Ping timeout: 252 seconds]
animo8 has joined #ruby
cow[moo] has joined #ruby
rippa has joined #ruby
<adam12> Swyper: Enumerable#any?
fanta1 has quit [Quit: fanta1]
Swyper has quit [Remote host closed the connection]
conta has quit [Ping timeout: 240 seconds]
phaul_ has joined #ruby
<animo8> Hi, I made a cool hack with the help of StackOverflow https://gist.github.com/omrisim210/0b4789ca7bb60328ac6c4fff1b9c4cf9
<animo8> Obviously it's a useless gimmick but it's nice for functional programming
chalkmonster has joined #ruby
LaChiave has joined #ruby
phaul_ has quit [Ping timeout: 268 seconds]
Intelo has quit [Remote host closed the connection]
Swyper has joined #ruby
mgraf__ has joined #ruby
robotcars has left #ruby [#ruby]
chalkmonster has quit [Ping timeout: 240 seconds]
ElFerna has joined #ruby
chalkmonster has joined #ruby
AJA4351 has joined #ruby
phaul_ has joined #ruby
AJA4350 has quit [Ping timeout: 265 seconds]
AJA4351 is now known as AJA4350
<havenwood> animo8: Nice. In modern Ruby you ca replace `caller[0][/`.*'/][1..-2]` with `caller_locations.first.label`.
Rapture has joined #ruby
<havenwood> animo8: You'll notice with a big enough number you'll get a: SystemStackError: stack level too deep
<havenwood> animo8: You can disable stack trace and enable tail call optimization to prevent that, if you want.
RiPuk_ has joined #ruby
RiPuk has quit [Ping timeout: 252 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
mikecmpbll has quit [Quit: inabit. zz.]
<animo8> havenwood: Huh, thanks for the tip
kabads has quit [Read error: Connection reset by peer]
Esa_ has joined #ruby
<animo8> I wasn't sure if this was the so-called "tail recursive style" (or whatever it's called) I kept hearing about since I'm not that good at functional programming but from what you're saying I'm going to assume that it is
mikecmpbll has joined #ruby
<havenwood> animo8: Any time! Yeah, Ruby isn't really made to work properly with recursion out of the box. Languages have to choose between TCO and stack traces as far as I know. Ruby defaults to stack trace but you can enable TCO either when you compile Ruby or with RubyVM::InstructionSequence.
<animo8> Do other implementations support TCO?
<havenwood> animo8: Then again... I think the caller info won't work if you disable `trace_instruction` in favor of `tailcall_optimization`.
<animo8> havenwood: Huh, that's kind of funny
<havenwood> animo8: Nope, not by default at least. JRuby and TruffleRuby will both blow up as well with SystemStackError. Stack overflow!
phaul_ has quit [Ping timeout: 268 seconds]
<animo8> It seemed to me that the JVM ones could be made to run pretty fast, but I guess it's always going to have to be a tradeoff between dynamicness and performance
<havenwood> animo8: JVM has super small stack iir. JRuby is really quite nice.
<animo8> I was going to check on google if Clojure allows you to get the caller at runtime but then I remembered my `recurse` hack could be implemented as a macro there
<animo8> I wish Crystal was mature enough so I could have my compile-time macros AND my Ruby
* baweaver wanders in
<havenwood> animo8: Matz is considering adding macros to Ruby. He was pondering deprecating back ticks for shelling out so they could be used for the new macro syntax - but decided that would break too much.
<havenwood> baweaver: o/
phaul_ has joined #ruby
<animo8> havenwood: That's a really interesting idea. Maybe a new string interpolation syntax could work for macros? Like backticks in Lisp
<animo8> Although macros need to operate on symbols and strings aren't symbols
<havenwood> animo8: Clojure implements a explicit recur since JVM doesn't support TCO.
<havenwood> an**
Yxhuvud has quit [Read error: Connection reset by peer]
<havenwood> my "n" key is borked
Yxhuvud has joined #ruby
<havenwood> animo8: It's a fun experiment to interop between Clojure and Ruby with JRuby and red bridge.
<havenwood> animo8: Or even fancier with TruffleRuby interop.
shah^ has joined #ruby
Tempesta_ has joined #ruby
<animo8> havenwood: That's really neat. Kind of reminds me of when I tried to write C wrappers for a tiny part of the STL
<havenwood> animo8: I want hardware transactional memory! I thought we'd have it by now.
Tempesta has quit [Read error: Connection reset by peer]
<animo8> havenwood: Why don't we have java/clr cpus yet /s
<havenwood> ¯\_(ツ)_/¯
<havenwood> I guess both are hard to make.
<animo8> Bare metal Ruby is the dream
<animo8> More like a nightmare though
<havenwood> It's a miracle anything works.
drincruz_ has quit [Quit: WeeChat 2.6]
RiPuk_ has quit [Ping timeout: 240 seconds]
RiPuk has joined #ruby
mgraf__ has quit [Ping timeout: 264 seconds]
consti has joined #ruby
AJA4351 has joined #ruby
<adam12> I'd like to see something akin to quote from Elixir.
mgraf__ has joined #ruby
<adam12> Blocks are kinda there, but I'd love to get access to the AST for a specific project.
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
<consti> Hi! I'm trying to use AES128 CBC to decrypt a value. I can't make it work. Not sure what I'm doing wrong.
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12> consti: Can you show some code?
JBmc has joined #ruby
<consti> @adam12 yes, sorry, had to update the gist: https://gist.github.com/consti/9af52fcc7fe6c861395fb38dabc250f3
r29v has joined #ruby
r29v has quit [Client Quit]
dbugger has quit [Remote host closed the connection]
<consti> I tried numerous variations (with padding not set, padding set to 1, with hex encoded $encrypted, upcased hex encoded $encrypted, non-hex $encrypted, with no IV, with 16*0 IV…). The page I mention in the comment (and others) just seem to work - unfortunately there's no insight on their implementation.
SeepingN has joined #ruby
<adam12> consti: So the return value of line 7 should be that long string of 0's plus a few other numbers?
JBmc has left #ruby [#ruby]
<consti> Reading the Ruby doc on OpenSSL unfortunately doesn't help.. the key etc. is given and I have no influence over IV (I read that 0 is a bad choice);
<consti> yes, correct
<adam12> consti: Does the return value have any significance? Was that the original value that you encoded?
<adam12> consti: Trying to follow but it's not clear.
<consti> yes, the return value is a MSISDN, padded with zeros
<consti> (a phone number)
mgraf__ has quit [Ping timeout: 265 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
<consti> Thanks @havenwood . The problem is that I don't have any say in how this gets encrypted. I was only given the key and was told IV is '0'.
<consti> …and that it's using AES-128 CBC
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
consti has quit [Read error: Connection reset by peer]
Intelo has joined #ruby
<havenwood> connor_goodwolf: Then set: iv = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
mikecmpbll has joined #ruby
<havenwood> oops, misstell
consti has joined #ruby
<havenwood> consti: it should be a 16 byte IV for 128 as well.
brool has joined #ruby
LaChiave has quit [Quit: Bye Bye]
<havenwood> consti: I didn't catch you were getting a 128 payload from elsewhere.
<consti> @havenwood correct, which is why I ended up using `0000000000000000`
<havenwood> consti: That's wrong.
<havenwood> &>> 0.chr * 16 == '0' * 16
<rubydoc> # => false (https://carc.in/#/r/7yjv)
Swyper has quit [Remote host closed the connection]
<havenwood> consti: Sixteen null bytes, not sixteen zeros.
<havenwood> &>> "\x00".ord
<rubydoc> # => 0 (https://carc.in/#/r/7yjx)
<havenwood> &>> "0".ord
<rubydoc> # => 48 (https://carc.in/#/r/7yjy)
<consti> Here's another tool that just seems to work (and doesn't need anything else key and input text): http://aes.online-domain-tools.com (not affiliated with that page, it looks crappy)
<havenwood> consti: You're saying 48 sixteen times when 0 sixteen times is expected.
<consti> ok
<havenwood> &>> 48.chr
<rubydoc> # => "0" (https://carc.in/#/r/7yk2)
<havenwood> &>> 0.chr
<rubydoc> # => "\x00" (https://carc.in/#/r/7yk3)
<consti> I just know that it didn't complain when I used 0 sixteen times :)
<havenwood> consti: It's a valid IV, but the wrong IV.
<havenwood> consti: You're saying 48 repeated but they told you 0 repeated.
<havenwood> The input is 16 numbers between 0 and 255.
<consti> ok
<havenwood> "\x00" is zero
<havenwood> "0" happens to be 48
<SeepingN> computers. Always straight forward.
<consti> :) ok. I now tried "\x00" 16 times, doesn't seem to solve it
<SeepingN> 1 more time
<consti> you are saying it should be 17 "\x00"?
dr_mdma_md has joined #ruby
<havenwood> consti: update your gist? is your key correctly represented? what did they say the key should be?
<SeepingN> No. Sorry, I'm trying to figure out wth you're trying to do
<consti> Key is correctly represented. You can try by using the tool mentioned in the comments (or the one I just posted here)
<Cork> is it possible to run the content (word by word) of a block through something like a method_missing (without falling back to normal ruby parsing)
<Cork> i'm trying to find a way to do something like writing powershell code in a do block and converting it to a correct string
<havenwood> &>> 45384643384437313035384532314445.to_s(16)
<rubydoc> # => "23cd5b11d80572f8fe561e1294d" (https://carc.in/#/r/7yk9)
<havenwood> ¯\_(ツ)_/¯
Guest49283 has joined #ruby
<consti> @havenwood I've updated the comments and provided screenshots of the other "tools"
<consti> the solution is probably very simple and I'm an idiot - ¯\_(ツ)_/¯
Ai9zO5AP has joined #ruby
spacesuitdiver has joined #ruby
<havenwood> consti: I'd personally just ask for clarification regarding the bytes for key and iv.
<Intelo> crossposting if anyone knows about this https://pastebin.ubuntu.com/p/Z4KX7K5zxh/
<havenwood> consti: Multitasking, but I'll look at the screenshots when I get a chance.
dinfuehr has quit [Ping timeout: 268 seconds]
<havenwood> consti: Once you know the 16 numbers each for key and iv, it's easy.
<consti> Unfortunately the person I'm dealing with here, won't be able to provide any more information. They literally sent me the info I posted in the gist and said that it works on those websites, so we should be able to make it work.
<havenwood> Give us a copy/pasteable version of what they said the key and iv would be?
Esa_ has quit []
<consti> The new encryption/decryption will be AES-128 (CBC with IV = 0). AES key: E8FC8D71058E21DE (hex 45384643384437313035384532314445)
<consti> (these are values for a test environment btw)
dinfuehr has joined #ruby
<consti> so nothing important/secret; I expect to have the IV value as "0" in production etc. as well; the key will change though
renich has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
<havenwood> consti: how is E8FC8D71058E21DE equivalent to 45384643384437313035384532314445? I'd have expected the hex representation to be twice as long and those ^ aren't the same number.
xco has joined #ruby
<al2o3-cr> &>> "E8FC8D71058E21DE".unpack1('H*')
<rubydoc> # => "45384643384437313035384532314445" (https://carc.in/#/r/7yki)
<havenwood> al2o3-cr: ah
<havenwood> &>> "45384643384437313035384532314445".scan(/\h\h/).map(&:hex).map(&:chr).join
<rubydoc> # => "E8FC8D71058E21DE" (https://carc.in/#/r/7ykl)
Inline has joined #ruby
dinfuehr has quit [Ping timeout: 265 seconds]
<leftylink> yeah let's see if I can remember what's going on by looking at my old cryptopals code
<leftylink> dang, they made us implement our own CBC... so I'll have to do some guesswork
<consti> Thanks al2o3-cr
mikecmpbll has joined #ruby
dinfuehr has joined #ruby
<leftylink> from what I can see from my cryptopals code: argument to cipher.update needs to be the exact bytes to be decrypted, not hex representation of it
Guest49283 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
<adam12> leftylink: That's correct. Getting close with hex_string.pack("H*"), but it looks like the hex string in the Gist is only partial of what I see.
<adam12> I wonder if padding has anything to do with it.
<adam12> The tool that consti is using says it pads with 0's. But it doesn't say to what length.
<leftylink> I see that cipher.key_len and cipher.iv_len are both 16, so they do need to both be strings with 16 bytes in them. so I think `cipher.key = "E8FC8D71058E21DE"` is correct.
<leftylink> bute note the difference between `cipher.iv = "0000000000000000"` and `cipher.iv = "\0" * 16`.
<havenwood> al2o3-cr: Nasty trick to make the hex have no letters. :P Threw me.
<al2o3-cr> yup ;)
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
<havenwood> consti: Is the payload?: 967596918
<havenwood> adam12: Padding takes an int, so looks like 0 is right. I think the payload was just represented as hex when it should be bytes.
<consti> No, it should be 0000000000000000000000000000000039363735393639313800000000000000
<leftylink> with those advices, I was able to get the expected decrypt, which is "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00967596918\x00\x00\x00\x00\x00\x00\x00" when printed out
<leftylink> good luck.
<consti> but it's a value that shows up on the second tool I posted
<havenwood> leftylink: yup, cool
<consti> so I think that's the correct value, but the wrong format?
andikr has quit [Remote host closed the connection]
dbugger has joined #ruby
<al2o3-cr> &>> require 'openssl'; c=OpenSSL::Cipher::AES128.new(:cbc);c.decrypt;c.padding=0;e="3bac4425bc2ad605e178a158581ad1fc42b55d06a74eb42b490024cc8f639382";c.key="E8FC8D71058E21DE";s=c.update([e].pack('H*')) << c.final; s.unpack1('H*')
<rubydoc> stderr: playpen: application terminated abnormally with signal 31 (Bad system call) (https://carc.in/#/r/7ykz)
<al2o3-cr> that works
<havenwood> #=> "0000000000000000000000000000000039363735393639313800000000000000"
<al2o3-cr> yay
<leftylink> if there is any doubt at all about whether the parameters being passed in are the correct types, I can recommend trying https://cryptopals.com/sets/1/challenges/7 . I know it's in ECB mode so there won't be an IV, but should give a close enough idea.
<havenwood> \o/
<consti> Wohoo!
<consti> Thank you al2o3-cr !
<havenwood> consti: They gave you very confusing examples for key, payload and iv...
<al2o3-cr> consti: yw
<adam12> Yeah. Unpacking the string to bytes worked (with padding 0). I had padding as 1 :O oh well.
<adam12> Mystery solved.
LaChiave has joined #ruby
<consti> Thank you, all of you!
<consti> I was trying to solve this all day… Thanks!
Rapture has quit [Ping timeout: 240 seconds]
Intelo has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
renich has quit [Quit: renich]
dinfuehr has quit [Ping timeout: 268 seconds]
dinfuehr has joined #ruby
renich has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.6]
LaChiave has quit [Quit: Bye Bye]
howdoi has joined #ruby
consti has quit [Quit: consti]
Intelo has joined #ruby
brendan- has quit [Ping timeout: 250 seconds]
ellcs has quit [Ping timeout: 250 seconds]
brendan- has joined #ruby
phaul_ has quit [Ping timeout: 265 seconds]
poontangmessiah has joined #ruby
phaul_ has joined #ruby
renich_ has joined #ruby
renich has quit [Ping timeout: 265 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
lucasb has quit [Quit: Connection closed for inactivity]
phaul_ has quit [Ping timeout: 240 seconds]
xco has joined #ruby
jaequery has joined #ruby
Inline has quit [Quit: Leaving]
jaequery has quit [Client Quit]
dionysus69 has quit [Ping timeout: 250 seconds]
jaequery has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
teclator has quit [Ping timeout: 240 seconds]
yasumi2136 has joined #ruby
phaul_ has joined #ruby
Axy has joined #ruby
Mia has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
dellavg has quit [Ping timeout: 265 seconds]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
renich has joined #ruby
renich_ has quit [Ping timeout: 240 seconds]
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
poontangmessiah has quit [Remote host closed the connection]
phaul_ has quit [Ping timeout: 265 seconds]
AJA4351 is now known as AJA4350
xco has joined #ruby
dinfuehr_ has joined #ruby
dinfuehr has quit [Ping timeout: 268 seconds]
fuzzface has joined #ruby
Swyper has quit [Remote host closed the connection]
renich_ has joined #ruby
Swyper has joined #ruby
renich has quit [Ping timeout: 250 seconds]
bacchist has quit [Ping timeout: 265 seconds]
sandstrom has joined #ruby
Swyper has quit [Remote host closed the connection]
bacchist has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
jbeaudoin_sher has joined #ruby
wildtrees has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
dr_mdma_md has quit [Quit: Connection closed for inactivity]
Swyper has quit [Ping timeout: 265 seconds]
ElFerna has quit [Quit: WeeChat 1.9.1]
cisco has joined #ruby
cisco is now known as Guest93657
akemhp has joined #ruby
yasumi2136 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
nima_m has joined #ruby
orbyt_ has joined #ruby
fuzzface has quit [Quit: Leaving]
tpanarch1st has quit [Ping timeout: 240 seconds]
tpanarch1st has joined #ruby
renich has joined #ruby
akemhp has quit [Ping timeout: 265 seconds]
Cyrus has quit [Ping timeout: 265 seconds]
AJA4351 has joined #ruby
renich_ has quit [Ping timeout: 276 seconds]
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
Cyrus has joined #ruby
TomyWork has quit [Ping timeout: 246 seconds]
spacesuitdiver has quit [Quit: Textual IRC Client: www.textualapp.com]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
suukim has quit [Quit: Konversation terminated!]
duderonomy has joined #ruby
Xiti` has joined #ruby
duderonomy has quit [Client Quit]
Xiti has quit [Ping timeout: 240 seconds]
Xiti` has quit [Remote host closed the connection]
Swyper has joined #ruby
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
dionysus70 is now known as dionysus69
sauvin has quit [Read error: Connection reset by peer]
yann-kaelig has joined #ruby
Xiti has joined #ruby
brendan- has quit [Ping timeout: 252 seconds]
Guest93657 has quit [Ping timeout: 265 seconds]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
akemhp has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
akemhp_ has joined #ruby
akemhp has quit [Ping timeout: 268 seconds]
cow[moo] has quit [Ping timeout: 240 seconds]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
phaul_ has joined #ruby
dr_mdma_md has joined #ruby
gix has joined #ruby
schne1der has joined #ruby
dbugger has quit [Quit: Leaving]
galaxie has quit [Remote host closed the connection]
galaxie has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
samdixon[m] has joined #ruby
akemhp_ has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
chalkmonster has joined #ruby
ur5us has joined #ruby
quazimodo has quit [Ping timeout: 265 seconds]
tpanarch1st has quit [Ping timeout: 240 seconds]
quazimodo has joined #ruby
tpanarch1st has joined #ruby
klaas has quit [Quit: ZNC 1.7.4 - https://znc.in]
phaul_ has quit [Ping timeout: 245 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
renich has quit [Read error: Connection reset by peer]
phaul_ has joined #ruby
klaas has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Axy has quit [Ping timeout: 265 seconds]
ravenousmoose has joined #ruby
Swyper has quit [Remote host closed the connection]
phaul_ has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
ravenousmoose has quit [Ping timeout: 252 seconds]
shirak has joined #ruby
Swyper has quit [Remote host closed the connection]
bvdw has quit [Quit: bvdw]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
john2496 has joined #ruby
phaul_ has joined #ruby
bvdw has joined #ruby
bvdw has quit [Client Quit]
tpanarch1st has quit [Ping timeout: 240 seconds]
bvdw has joined #ruby
quazimodo has quit [Ping timeout: 276 seconds]
teardown has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 276 seconds]
quazimodo has joined #ruby
shirak has quit [Ping timeout: 268 seconds]
eljimmy has quit [Quit: This computer has gone to sleep]
eljimmy has joined #ruby
eljimmy has quit [Client Quit]
eljimmy has joined #ruby
eljimmy has quit [Client Quit]
eljimmy has joined #ruby
schne1der has quit [Ping timeout: 265 seconds]
phaul_ has quit [Ping timeout: 265 seconds]
<Net> ruby enumerators don't hold references to values before the current iteration position, do they?
<baweaver> unless you're explicitly using an index, not really
<baweaver> Though it depends on what you're trying to do.
jenrzzz has joined #ruby
<phaul> you can rewind ... and starrt from the begining
<Net> I'm asking because I'm iterating over a very long and memory intensive list that can be represented as a lazy enum (the values are fetched in chunks from an api) and I'm wondering if that's a potential performance benefit
<phaul> btw - Enumerators are not indexable, are they?
<Net> the immediate method I'd want to call on the enum is #flat_map, though I presume that has the same underlying behavior as #next
<baweaver> `each_slice(2)` potentially
<Net> each_slice(2)?
woodruffw has quit [Quit: And then he took off.]
dionysus69 has quit [Quit: dionysus69]
<phaul> I would be careful if that forces the whole thing to be allocated though, one has to test.. Otherwise just implement caching the last element yourself
<phaul> like a local variable in the block
woodruffw has joined #ruby
woodruffw has joined #ruby
woodruffw has quit [Changing host]
akemhp has joined #ruby
<Net> phaul: flat_map?
<Net> I tested, it doesn't
<phaul> no. each_slice(2)
<phaul> I *think* the methods from https://ruby-doc.org/core-2.6/Enumerator/Lazy.html are fine
ellcs has joined #ruby
<Net> I don't understand what each_slice is for
<phaul> &>> [*(1..10)].each_slice(2).entries
<rubydoc> # => [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]] (https://carc.in/#/r/7yn6)
akemhp_ has joined #ruby
<Net> I mean, I understand what it does
<Net> I don't understand why we're talking about it :)
troulouliou_dev has quit [Quit: Leaving]
<phaul> I think baweaver meant each_cons(2) actually, suggesting to walk the list in consequtive pairs
<phaul> first of the pair is the previous elem, last of the pair is the current
<Net> interestingly each_slice doesn't allocate the whole thing at once either
<Net> I'm really missing something here
akemhp has quit [Ping timeout: 240 seconds]
<phaul> &>> enum = [*(1..10)].to_enum; enum.each_cons(2) { |prev, current| p prev-current }
<rubydoc> # => -1... check link for more (https://carc.in/#/r/7yna)
chalkmonster has quit [Quit: WeeChat 2.6]
<phaul> I think this was the gist of the suggestion
<Intelo> I added domain as .site.com and now its setting cookie with different value on every request. _wa_session=3f8935b9488d20ecfbba118a4ffcbb14; domain=.site.com; path=/; HttpOnly
<Net> was this a suggestion to me or someone else?
<Net> I am incredibly confused :D
<phaul> sorry probably I added more confusion than help. I thought it was for you.
akemhp_ has quit [Ping timeout: 240 seconds]
<Net> I did too, I just don't understand how it's related
akemhp has joined #ruby
<Net> anyways, I wasn't aware enumerable methods called on lazy enumerators returned a lazy enumerators, and that's good to know
<Net> I suppose that's partially the point of lazy enumerators
quazimodo has quit [Ping timeout: 240 seconds]
ellcs has quit [Ping timeout: 276 seconds]
AJA4350 has joined #ruby
akemhp_ has joined #ruby
_dbugger has joined #ruby
_dbugger has quit [Remote host closed the connection]
akemhp has quit [Ping timeout: 245 seconds]
<phaul> doing it with local variables, that surely keeps it lazy: Enumerator.new { |y| prev = nil; 5.times {|i| y << [prev, i]; prev = i } }
_dbugger has joined #ruby
markov_twain has joined #ruby
go|dfish has quit [Ping timeout: 250 seconds]
john2496 has quit []
eljimmy has quit [Quit: This computer has gone to sleep]
jaequery has joined #ruby
vrih has joined #ruby
markov_twain has quit [Remote host closed the connection]
go|dfish has joined #ruby
Swyper has quit [Remote host closed the connection]
akemhp has joined #ruby
akemhp_ has quit [Ping timeout: 268 seconds]
akemhp_ has joined #ruby
akemhp has quit [Ping timeout: 240 seconds]
akemhp_ has quit [Ping timeout: 268 seconds]
_dbugger has quit [Remote host closed the connection]
_dbugger has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_dbugger has quit [Remote host closed the connection]
_dbugger has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
<Intelo> I keep on getting new session cookie value _wa_session on every request. Can anyone tell why? https://pastebin.ubuntu.com/p/fmQ75PC6Pz/
Nicmavr has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
Swyper has joined #ruby
markov_twain has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
_dbugger has quit [Remote host closed the connection]
jenrzzz has joined #ruby
dbugger has joined #ruby
dbugger has quit [Remote host closed the connection]
dbugger has joined #ruby
Swyper has quit [Remote host closed the connection]
bvdw has quit [Quit: bvdw]
bvdw has joined #ruby
vrih has quit [Remote host closed the connection]
Swyper has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
cisco has joined #ruby
cisco is now known as Guest99129
markov_twain has quit [Read error: Connection reset by peer]
davidw has quit [Read error: Connection reset by peer]
markov_twain has joined #ruby
jenrzzz has joined #ruby
Swyper has quit [Remote host closed the connection]
shirak has joined #ruby
nima_m has quit [Quit: Connection closed for inactivity]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby