Encrypt_BlowFish2 problem

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Encrypt_BlowFish2 problem

Trevor Jacques
I had thought that the new encrypt BlowFish tag would solve some
problems for me, since it produces the same result every time it is
used on a string, with the same seed. This is does do, but those
resultant strings contain non-alphanumeric characters.

Anyone know of a way to reliably produce the same encrypted string,
but with only alphanumeric characters in it?

Thanks.

T.

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Encrypt_BlowFish2 problem

Adam Randall-4
[encode_base64(encrypt_blowfish2(-seed = 'my seed', 'string'))]

On Sep 6, 2006, at 4:01 PM, Trevor Jacques wrote:

> I had thought that the new encrypt BlowFish tag would solve some  
> problems for me, since it produces the same result every time it is  
> used on a string, with the same seed. This is does do, but those  
> resultant strings contain non-alphanumeric characters.
>
> Anyone know of a way to reliably produce the same encrypted string,  
> but with only alphanumeric characters in it?
>
> Thanks.
>
> T.
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:  http://www.listsearch.com/ 
> lassotalk.lasso?manage



--
Adam Randall <[hidden email]>
Senior Web Architect
Stork Avenue, Inc.
http://www.storkavenue.com
(800) 861-5437 x137




------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Encrypt_BlowFish2 problem

Trevor Jacques
>[encode_base64(encrypt_blowfish2(-seed = 'my seed', 'string'))]

That was quick. :-) Thanks.

T.

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Encrypt_BlowFish2 problem

Bil Corry-3
In reply to this post by Adam Randall-4
This is what I use:

  http://tagSwap.net/lp_var_pack
  http://tagSwap.net/lp_var_unpack


For example:

  var:'test' = 'hello world';
  $test;'<br>';
  var:'pack' = (lp_var_pack: $test, 'secret');
  var:'unpack' = (lp_var_unpack: $pack, 'secret');
  $unpack;'<br>';


- Bil


Adam Randall wrote:

> [encode_base64(encrypt_blowfish2(-seed = 'my seed', 'string'))]
>
> On Sep 6, 2006, at 4:01 PM, Trevor Jacques wrote:
>
>> I had thought that the new encrypt BlowFish tag would solve some
>> problems for me, since it produces the same result every time it is
>> used on a string, with the same seed. This is does do, but those
>> resultant strings contain non-alphanumeric characters.
>>
>> Anyone know of a way to reliably produce the same encrypted string,
>> but with only alphanumeric characters in it?
>>
>> Thanks.
>>
>> T.


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Encrypt_BlowFish2 problem

Trevor Jacques
>Bil wrote:
>  http://tagSwap.net/lp_var_pack
>  http://tagSwap.net/lp_var_unpack

Thanks for the pointer. :-)

T.

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Encrypt_BlowFish2 problem

Trevor Jacques
In reply to this post by Adam Randall-4
>[encode_base64(encrypt_blowfish2(-seed = 'my seed', 'string'))]

Close, but no cigar. Here's an example result of the above:

aWGU9WL/4jnbAbKp3GDqnhQ==

Having / or = in the string won't work for me. The string HAS to be
alphanumeric.  :-/

T.

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Encrypt_BlowFish2 problem

Kyle Jessup

On Sep 6, 2006, at 4:39 PM, Trevor Jacques wrote:

>> [encode_base64(encrypt_blowfish2(-seed = 'my seed', 'string'))]
>
> Close, but no cigar. Here's an example result of the above:
>
> aWGU9WL/4jnbAbKp3GDqnhQ==
>
> Having / or = in the string won't work for me. The string HAS to be  
> alphanumeric.  :-/

Try encode_hex instead of base64.

-K


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Encrypt_BlowFish2 problem

Trevor Jacques
>Try encode_hex instead of base64.

A thing of beauty (at least, my tests couldn't break it). Thanks, Kyle.  :-)

T.

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Encrypt_BlowFish2 problem

Bil Corry-3
In reply to this post by Trevor Jacques
Trevor Jacques wrote:
>> Bil wrote:
>>  http://tagSwap.net/lp_var_pack
>>  http://tagSwap.net/lp_var_unpack
>
> Thanks for the pointer. :-)

I updated them to allow hex encoding instead.

- Bil


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Encrypt_BlowFish2 problem

Trevor Jacques
>>>Bil wrote:
>>>  http://tagSwap.net/lp_var_pack
>>>  http://tagSwap.net/lp_var_unpack
>I updated them to allow hex encoding instead.

Excellent! Thanks. :-)

FWIW, I had created something similar, but I realised that I had to
prepend an 'a' (or any other alpha character). This is because the
tag might otherwise have generated a string that started with a
numeral, which JavaScript does not like for its variables/form
element names. It's a simple change to the code, but it means that
the resultant string can be used on a page for both the name of a
form input AND reference to that form element by JavaScript.  :-)

T.

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Encrypt_BlowFish2 problem plus Variable conundrum

Trevor Jacques
In reply to this post by Kyle Jessup
Now, joining my two threads:

[var: 'string1' + (process: '[if: ((Lasso_Version: -LassoVersion) >=
8.0)]a[encode_hex(Encrypt_BlowFish2('string2',
-seed=$Seed))][else]string2[/if]')]

does not work. It coughs at the first instance of string2, with an
error message:

No tag, type or constant was defined under the name "string2".

:-/

Note that the If statement evaluates just fine outside this Process tag.

I do have a workaround, since this was just one of the steps during
testing. I was just trying a proof of principle with the whole,
detailed enchilada, first, and came across a problem that looked like
it needed reporting.

I suspect that something is wonky in the Process tag, again. I've
probably nested something where I should not. It's not obvious from
the docs., though, and I've checked and rechecked that everything is
balanced.... There's no obvious (to me) reason why this should fail,
or that it should give the error that it does.

T.

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Encrypt_BlowFish2 problem plus Variable conundrum

Bil Corry-3
Trevor Jacques wrote:
> [var: 'string1' + (process: '[if: ((Lasso_Version: -LassoVersion) >=
> 8.0)]a[encode_hex(Encrypt_BlowFish2('string2',
> -seed=$Seed))][else]string2[/if]')]
>
> does not work. It coughs at the first instance of string2, with an error
> message:

You are using single-quotes as a string delimiter and you have single-quotes within the string, causing Lasso to prematurely end the string.  Try this instead:

[var: 'string1' + (process: "[if: ((Lasso_Version: -LassoVersion) >= 8.0)]a[encode_hex(Encrypt_BlowFish2('string2', -seed=$Seed))][else]string2[/if]")]


And [encode_hex] was added in Lasso 8.0.2, so Lasso 8.0.0 and 8.0.1 won't be able to use it.


- Bil


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Encrypt_BlowFish2 problem plus Variable conundrum

Trevor Jacques
>You are using single-quotes as a string delimiter and you have
>single-quotes within the string,

Duh. Thanks. :-)

>And [encode_hex] was added in Lasso 8.0.2, so Lasso 8.0.0 and 8.0.1
>won't be able to use it.

Thanks, again. I'll add that to the code. :-)

T.

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage