[#396148] Facebook Group — Moses Aronov <mosesaro@...>

There is a facebook group that was recently created so we could all communicate with other fellow developers

13 messages 2012/06/05
[#396178] Re: Facebook Group — Chad Perrin <code@...> 2012/06/06

On Wed, Jun 06, 2012 at 01:55:48AM +0900, Moses Aronov wrote:

[#396186] Inexplicable Argument Error — Doug Jolley <lists@...>

I am encountering a very strange argument error. I simplified my code

12 messages 2012/06/06

[#396229] Thread#kill is not rescued by "rescue Exception" — Iñaki Baz Castillo <ibc@...>

Hi, let me show this easy code:

13 messages 2012/06/07

[#396333] Is "a,b=c,d" atomic? or do I need a Mutex? — Iñaki Baz Castillo <ibc@...>

Hi, I have two methods that could be called by different threads and

10 messages 2012/06/10

[#396357] ffi - Popping image on top of the screen — "Damián M. González" <lists@...>

Ey guys, how are you? I`m developing an application in Ruby, using

12 messages 2012/06/11

[#396373] Why should I learn ruby? — Kasper Steensig <lists@...>

I have wondered whether I should learn ruby or python hence they are

16 messages 2012/06/11

[#396503] Syntax Highlighter — Intransition <transfire@...>

Would you agree that Ruby shouldn't lack for a syntax highlighting library

18 messages 2012/06/14

[#396589] Unsubcripe — Suresh Rajkumar <sureshrajchennai@...>

Unsubcipe my mail address from the group.

13 messages 2012/06/18

[#396615] Symbols and Strings... — Hal Fulton <rubyhacker@...>

Hello, all...

29 messages 2012/06/18
[#396620] Re: Symbols and Strings... — Eric Hodel <drbrain@...7.net> 2012/06/18

On Jun 18, 2012, at 15:09, Hal Fulton wrote:

[#396641] Re: Symbols and Strings... — Robert Klemme <shortcutter@...> 2012/06/19

On Tue, Jun 19, 2012 at 12:31 AM, Eric Hodel <drbrain@segment7.net> wrote:

[#396643] Re: Symbols and Strings... — Hal Fulton <rubyhacker@...> 2012/06/19

Personally, I don't have a problem with "reducing the contract"

[#396646] Re: Symbols and Strings... — Robert Klemme <shortcutter@...> 2012/06/19

On Tue, Jun 19, 2012 at 5:17 PM, Hal Fulton <rubyhacker@gmail.com> wrote:

[#396659] Re: Symbols and Strings... — Hal Fulton <rubyhacker@...> 2012/06/19

> > Freezing an object also reduces its contract.

[#396678] Re: Symbols and Strings... — Robert Klemme <shortcutter@...> 2012/06/20

On Tue, Jun 19, 2012 at 10:12 PM, Hal Fulton <rubyhacker@gmail.com> wrote:

[#396701] Re: Symbols and Strings... — Henry Maddocks <hmaddocks@...> 2012/06/20

[#396702] Re: Symbols and Strings... — Bartosz Dziewoński <matma.rex@...> 2012/06/20

2012/6/20 Henry Maddocks <hmaddocks@me.com>:

[#396703] Re: Symbols and Strings... — Henry Maddocks <hmaddocks@...> 2012/06/20

[#396710] Re: Symbols and Strings... — Jeremy Bopp <jeremy@...> 2012/06/20

On 06/20/2012 03:58 PM, Henry Maddocks wrote:

[#396627] Does ERB have recursive template support? — Todd Wei <lists@...>

I want to use ERB template library to do some code generation. It

10 messages 2012/06/19

[#396649] Looking for a better way to add a method to a core class than monkey patching — Iain Barnett <iainspeed@...>

Hi all,

17 messages 2012/06/19
[#396670] Re: Looking for a better way to add a method to a core class than monkey patching — Avdi Grimm <groups@...> 2012/06/20

Please do not monkey patch core libraries in gems, unless the *purpose* of

[#396685] Benchmark obsession? — "Jan E." <lists@...>

Hi,

23 messages 2012/06/20
[#396709] Re: Benchmark obsession? — Ryan Davis <ryand-ruby@...> 2012/06/20

[#396815] Array#sample is Set#sample and not Array#sample ! — Michel Demazure <lists@...>

Arrays are ordered, sets are not. Sampling an array should give random

11 messages 2012/06/25

[#396877] CSV.open problem, help please — Kaye Ng <lists@...>

This code doesn't seem to work

21 messages 2012/06/27

[#396896] Copying text from MS Word and wrapping in HTML - help please — Adam Holloway <lists@...>

Hi,

11 messages 2012/06/27

[#396966] Interactions between 'new' and 'initialize' ? — Cees Zeelenberg <lists@...>

In JRuby, I am extending an existing Java Class with a Ruby initialising

9 messages 2012/06/28

[#396975] stack level too deep for quicksort code — bei zhao <lists@...>

Hi, below is my quicksort implementation in ruby(using the first element

12 messages 2012/06/28

[#396996] Accessor Methods with a Twist — Doug Jolley <lists@...>

I am surprised that the code shown below returns, 'Doug'. I would

15 messages 2012/06/29

[#397001] ruby performance — anaray anaray <lists@...>

Hi,

33 messages 2012/06/29
[#397007] Re: ruby performance — Bartosz Dziewoński <matma.rex@...> 2012/06/29

The MRI is, unfortunately, slow as balls, and there's not much you can

[#397008] Re: ruby performance — Hans Mackowiak <lists@...> 2012/06/29

Bartosz Dziewoナгki wrote in post #1066673:

[#397010] Re: ruby performance — Bartosz Dziewoński <matma.rex@...> 2012/06/29

2012/6/29 Hans Mackowiak <lists@ruby-forum.com>:

[#397011] Re: ruby performance — Bartosz Dziewoński <matma.rex@...> 2012/06/29

2012/6/29 Hans Mackowiak <lists@ruby-forum.com>:

[#397047] Re: ruby performance — "Andreas S." <lists@...> 2012/07/01

Bartosz Dziewoński wrote in post #1066681:

[#397048] Re: ruby performance — Bartosz Dziewoński <matma.rex@...> 2012/07/01

2012/7/1 Andreas S. <lists@ruby-forum.com>:

[#397068] Re: ruby performance — Robert Klemme <shortcutter@...> 2012/07/02

On Sun, Jul 1, 2012 at 1:42 PM, Bartosz Dziewoナгki <matma.rex@gmail.com> wrote:

[#397086] Re: ruby performance — Dan Connelly <lists@...> 2012/07/02

Here's my contribution:

Re: OpenSSL: Determining initialization vector (IV) created using OpenSSL::Cipher::Cipher#pkcs5_keyivgen with one argument

From: T P <tty0pts@...>
Date: 2012-06-11 00:43:20 UTC
List: ruby-talk #396346
Hi Martin,

On Sun, Jun 10, 2012 at 5:48 PM, Martin Bo煬et <
martin.bosslet@googlemail.com> wrote:

>
> salt is initialized as null, but later set in the line
>
>
>
 salt = (unsigned char *)RSTRING_PTR(vsalt);
>

> The Ruby String vsalt's value is assigned to salt there.
>
> Except I believe that is inside the if block that checks whether or not
vsalt was passed in or not:

if(!NIL_P(vsalt)){
...
}

So that wouldn't get set, I believe. I should have explained my reasoning
in the original message to be clear. Maybe that isn't what NIL_P is doing
though or that when an argument isn't passed in it gets a non NULL value?
Perhaps NIL (in Ruby/C API) and NULL (in C) are different?

I probably should have also mentioned that the actual call in
encrypted_strings gem that we indirectly call is:
cipher.pkcs5_keyivgen(password), only one argument is passed in.


> > (b) at some point I would love to learn how to debug this myself. i.e.
> setup
> > my environment to trace the C code in the Ruby MRI runtime so I can fish
> for
> > myself next time.
>
>

You may simply use gdb or if you prefer some comfort, I frequently use

Netbeans to debug
> Ruby C code.
>
> > If the salt variable is NULL then what is the IV used in this case? I
> need
> > th IV for the Scala code otherwise I cannot decrypt what the Ruby code is
> > encrypting. Also I found a highly related StackOverflow question on this
> > [2], but the solution involves not using pkcs5_keyivgen method at all and
> > setting a known random IV on the OpenSSL::Cipher::Cipher object so it
> > doesn't answer my question sadly as I am not in a position to do this
> > migration yet.
>
> You shouldn't require the actual key and IV used to do password-based
> encryption. What you would normally do on the receiving end is to go
> through the same steps as you did when encrypting the initial message,
> using the same password, salt and iterations that the encrypting party
> used. In Java, this would look something like
>
> ----- start source
>
> //These three need to be exactly the same as the ones used in Ruby
> char[] password = ...
> byte[] salt = ...
> int count = ...
>
> PBEParamterSpec params = new PBEParameterSpec(salt, count);
> PBEKeySpec keySpec = new PBEKeySpec(password);
> SecretKeyFactory keyFac = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
> SecretKey key = keyFac.generateSecret(keySpec);
> Cipher cipher = Cipher.getInstance("PBEWithMD5AndDES");
> pbeCipher.init(Cipher.DECRYPT_MODE, key, params);
> //now decrypt
>
> ----- end source
>
> Figuring out what the key and iv are that were generated would sort of
> defeat the purpose of password-based encryption. Although not
> impossible, it would definitely result in a lot more work.
>
> For your migration to using PBKDF2, I just added some notes on
> how to use it yesterday [1]. I also gave an example on SO how we
> did similar upgrading of password schemes in the past [2]. It talks
> about moving from MD5 to bcrypt but applies to arbitrary algorithms.
> I hope this still helps you in the process!
>

Thanks, I will definitely use that for reference in our longer-term plans.
Great idea with the two concurrent values!

I think I figured out a workaround anyway for the short-term deliverable
that can't wait for a migration path like that in the meantime. Testing now
and will post if successful.

Thanks! :)

In This Thread

Prev Next