# |
Apr 23rd 2019, 15:40 |
josbeir |
amqp |
# |
Apr 23rd 2019, 15:40 |
slackebot |
anything for it in CakeResque, Fresque, Queuesadilla, Gearman either. |
# |
Apr 23rd 2019, 15:40 |
dereuromark |
How do people do job queuing (those that actually do this kind of thing in their apps^^) when you have limited resources per server and some more expensive tasks? we have some 2GB composer update, and we need to limit simultaneous runs here per queue server (either per job type or by cost of those tasks in general). I have to extend my plugin here, just wondering how the other solutions handle this kind of thing in (Cake)PHP. I didnt see |
# |
Apr 23rd 2019, 15:39 |
neon1024 |
You taking over from ADmad ? |
# |
Apr 23rd 2019, 15:39 |
dereuromark |
Actually, I have an important queue issue to solve. |
# |
Apr 23rd 2019, 15:39 |
neon1024 |
Haha |
# |
Apr 23rd 2019, 15:38 |
dereuromark |
I was enough disappointed with you last week. |
# |
Apr 23rd 2019, 15:38 |
neon1024 |
No?! Mark! Dude |
# |
Apr 23rd 2019, 15:38 |
neon1024 |
..and that I should visit his sandbox for an example |
# |
Apr 23rd 2019, 15:38 |
dereuromark |
Actually, no :) |
# |
Apr 23rd 2019, 15:38 |
josbeir |
:) |
# |
Apr 23rd 2019, 15:38 |
neon1024 |
He’ll say he’s got a plugin |
# |
Apr 23rd 2019, 15:38 |
neon1024 |
@phantomwatson Hopefully you can learn it before implementing it into prod :P |
# |
Apr 23rd 2019, 15:38 |
josbeir |
i have the feeling @dereuromark has something very interesting to add to the conversation |
# |
Apr 23rd 2019, 15:37 |
josbeir |
:) |
# |
Apr 23rd 2019, 15:37 |
neon1024 |
Thanks! :P |
# |
Apr 23rd 2019, 15:37 |
neon1024 |
Yeah good idea, I’ll ask the user with their primary key is |
# |
Apr 23rd 2019, 15:36 |
josbeir |
i'm no expert tho |
# |
Apr 23rd 2019, 15:36 |
josbeir |
you should lookup your db row with some other identifier and do the comparison after fetching |
# |
Apr 23rd 2019, 15:36 |
slackebot |
<neon1024> |
# |
Apr 23rd 2019, 15:35 |
phantomwatson |
Huh. I also assumed that it would always be the same output for the same input. |
# |
Apr 23rd 2019, 15:35 |
neon1024 |
Guess I’ll rewatch this https://www.youtube.com/watch?v=RTZXgxYGOWAandlist=PL_aPVo2HeGF9Hf1dr6lI7f6jJ48zqcz_fandindex=8andt=0s |
# |
Apr 23rd 2019, 15:34 |
phantomwatson |
Note `$iv = openssl_random_pseudo_bytes($ivSize);` |
# |
Apr 23rd 2019, 15:34 |
phantomwatson |
Oh, I'm just now seeing ``` public static function encrypt($plain, $key) { $method = 'AES-256-CBC'; $ivSize = openssl_cipher_iv_length($method); $iv = openssl_random_pseudo_bytes($ivSize); return $iv . openssl_encrypt($plain, $method, $key, OPENSSL_RAW_DATA, $iv); } ``` |
# |
Apr 23rd 2019, 15:34 |
josbeir |
learned that to at some point :slightly_smiling_face: |
# |
Apr 23rd 2019, 15:34 |
neon1024 |
I don’t fancy reading and decrypting my whole database table |
# |
Apr 23rd 2019, 15:34 |
josbeir |
yeah, i get that |
# |
Apr 23rd 2019, 15:33 |
neon1024 |
I certainly didn’t, but I did totally miss the fact that encryption does not produce consistant output |
# |
Apr 23rd 2019, 15:32 |
josbeir |
people always confuse encryption with hashing |
# |
Apr 23rd 2019, 15:32 |
neon1024 |
@josbeir `ctype_xdigit($value)` |
# |
Apr 23rd 2019, 15:32 |
josbeir |
yes |
# |
Apr 23rd 2019, 15:32 |
josbeir |
or you could decrypt it and compare that |
# |
Apr 23rd 2019, 15:32 |
neon1024 |
:P |
# |
Apr 23rd 2019, 15:32 |
neon1024 |
So I’ve filled my database with gibberish! :,( |
# |
Apr 23rd 2019, 15:32 |
josbeir |
but you should be able to check if the string is encrypted using a specific cypher method |
# |
Apr 23rd 2019, 15:31 |
josbeir |
so you will not be able to compare it |
# |
Apr 23rd 2019, 15:31 |
josbeir |
security::encrypt produces an encrpyted string wich will be always random stuff, it does not produce a hash |
# |
Apr 23rd 2019, 15:31 |
neon1024 |
Which could well be how I’ve ended up in this hole |
# |
Apr 23rd 2019, 15:31 |
neon1024 |
This feels intentional to me, which means the hole is in my understanding of encryption |
# |
Apr 23rd 2019, 15:31 |
neon1024 |
The same results occur when using a CONST |
# |
Apr 23rd 2019, 15:29 |
phantomwatson |
I mean. Maybe not having different results in _the same test_, but it's still worth checking. |