j602:
load'convert/misc/md5'
md5 'example'
1a79a4d60de6718e8e5b326e338ae533
j64-802:
load'convert/misc/md5'
md5 'example'
64a9df64d8defee229d86709a425ea7a
This is a problem...
==
Raul
--
For information about J for
Wow! I wonder which hash is the correct md5 hash? Where did the code for
each of them come from?
Skip
Skip Cave
Cave Consulting LLC
On Sat, Sep 6, 2014 at 8:10 AM, Raul Miller wrote:
> j602:
>
>load'convert/misc/md5'
>md5 'example'
> 1a79a4d60de6718e8e5b326e338ae533
>
> j64-802:
>
>
I computed the hash in Python and the J602 version matches:
import hashlib
m = hashlib.md5()m.update('example')m.hexdigest()
gives:
'1a79a4d60de6718e8e5b326e338ae533'
Also any number of online md5 checkers give the same result to J602.
> Date: Sat, 6 Sep 2014 08:21:59 -0500
> From: s...@caveco
I got the 1a7... on android j802. I suspect this is a J64 bug.
On Sep 6, 2014 9:43 PM, "Jon Hough" wrote:
>
>
>
> I computed the hash in Python and the J602 version matches:
> import hashlib
> m = hashlib.md5()m.update('example')m.hexdigest()
> gives:
> '1a79a4d60de6718e8e5b326e338ae533'
> Also
The j602 version is correct, and the same code is used in each.
The problem seems to be that the code was designed for 32 bit integers.
Note also that the reference C implementation based on RFC 1321
(http://www.rfc-editor.org/rfc/rfc1321.txt) gives exactly the same
results on 32 bit and 64 bit
the code in rfc assume long int (uint4) is 4 bytes which should be valid in
the era of 80386.
On Sep 6, 2014 10:05 PM, "Raul Miller" wrote:
> The j602 version is correct, and the same code is used in each.
>
> The problem seems to be that the code was designed for 32 bit integers.
>
> Note also
It was written and tested for 32 bits. J7-64 also gives the wrong answer.
At the bottom of this page there are openssl bindings to similar hashes.
http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows
all the bound hashes are the same speed when called, but I a
I can't use your implementation, since I'm not running this on windows.
That said, I've got a fix for my code.
That said, I do not have a fix for the portable code in convert/misc/md5.
The first thing which would need to be fixed there are the uses of 32
b. and 33 b. (in the definitions of sh_pc
the code was tested at one point on mac. There is an attempt in the
definitions (at bottom of page only) to link on linux. assumes
/usr/lib/libssl.so . Should work? or few changes needed to work on linux?
- Original Message -
From: Raul Miller
To: Programming forum
Cc:
Sent: Satur
I tried your code at
http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows
sha256 hexhash 'The quick brown fox jumps over the lazy dog'
|domain error: cd
|
CryptAcquireContext(aProv=.,_1);(<0);(<0);PROV_RSA_AES;CRYPT_VERIFYCONTEXT
Meanwhile, what I have
You are using the wrong code. That is indeed windows specific bindings. The
openssl bindings are at the bottom of the page. Though you may want to pick up
hexhash definition from the top section.
- Original Message -
From: Raul Miller
To: Programming forum
Cc:
Sent: Saturday,
I used the code from the bottom of the page.
Quite possibly I should have used it differently, but that's a different issue.
Thanks,
--
Raul
On Sat, Sep 6, 2014 at 11:46 AM, 'Pascal Jasmin' via Programming
wrote:
> You are using the wrong code. That is indeed windows specific bindings. The
You did not go far enough down the page :P CryptAcquireContext is only used in
the MSFT binding not openssl binding
- Original Message -
From: Raul Miller
To: Programming forum
Cc:
Sent: Saturday, September 6, 2014 11:49 AM
Subject: Re: [Jprogramming] md5 is not md5
I used the code
also, the openssl sha256 verb is called s256.
- Original Message -
From: 'Pascal Jasmin' via Programming
To: "programm...@jsoftware.com"
Cc:
Sent: Saturday, September 6, 2014 11:52 AM
Subject: Re: [Jprogramming] md5 is not md5
You did not go far enough down the page :P CryptAcquireCo
Here's what happens if I use that code and only extract hexhash from
the top (instead of simply incorporating both blocks of code):
s256 hexhash 'The quick brown fox jumps over the lazy dog'
|value error: sslSha256
| sslSha256(y);(#y);md=.32#' '
So, ok, what's wrong with sslSha256?
s
what is sslp defined as?
Is it possible IFIOS is not defined? or less likely UNAME_z_?
- Original Message -
From: Raul Miller
To: Programming forum
Cc:
Sent: Saturday, September 6, 2014 11:57 AM
Subject: Re: [Jprogramming] md5 is not md5
Here's what happens if I use that code and on
I just came to the realization that ragged array shapes, regardless of how
you want to represent them, are trees. I would be interested in any
references to prior exploration of this idea.
Some example data (boxes are used to display ragged arrays, but otherwise
have no semantic meaning):
] A
IFIOS
0
UNAME_z_
Linux
sslp =: IFWIN pick '/usr/lib/';'D:\OpenSSL-Win64\bin\'
sslp
/usr/lib/
Looking closer, I'm thinking you probably want
/lib/x86_64-linux-gnu/libssl.so.1.0.0 rather than /usr/lib/libssl.so
(which does not exist).
That said, the domain error is because you are tryin
Trees are an abstraction.
Conceptually speaking all arrays - even non-ragged - can be thought of
as trees. Whether they are very flat trees (only one level deep) or
very tall and skinny trees (only one child at each node) or whether
they are something else is not pre-determined.
And that's the pr
Hi Michal,
maybe this is an interesting representation for what you want?
([:|. $ ;~ $ each) (i. 2 3) ; (,0) ; 0 1
┌─┬─┐
│3│┌───┬─┬─┐│
│ ││2 3│1│2││
│ │└───┴─┴─┘│
└─┴─┘
- Original Message -
From: Michal D.
To: programm...@jsoftware.com
Cc:
Sent: Saturday, Sep
sorry about domain error, fixed on wiki, changing line to:
OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i.
To: Programming forum
Cc:
Sent: Saturday, September 6, 2014 12:12 PM
Subject: Re: [Jprogramming] md5 is not md5
IFIOS
0
UNAME_z_
Linux
sslp =: IFWIN pick '/usr/lib/
I haven't tested this on J64, but something like
removeupper =: (_1 xor 32 (33 b.) _1)&and
rot =: (removeupper or _32&(33 b.))@:(32 b.)
sh =: removeupper&(33 b.)
will work on J32 and J64, but you would need to apply removeupper also
to the negative constants: T and q
Henry Rich
On
This works on that machine:
OPENSSL=: '/lib/x86_64-linux-gnu/libssl.so.1.0.0'
sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x
*c') ssl NB. SHA256 i *c l *c' ssl
s256=: 3 : 0
sslSha256 (y);(#y);md=. 32#' '
md
)
hexhash =: ( [: ,@:hfd a.i.])@:
s256 h
This is multi-arch. if we just use the bare file name,
OPENSSL=: 'libssl.so.1.0.0'
it will work on 32-bit and 64-bit, and also
works for 32-bit process on 64-bit host.
should also works on raspi even the prefix would be
/lib/arm-linux-gnueabihf/
all J8 addons use this scheme for shared objects.
with that info, I've changed 2 lines on wiki:
sslp =: IFWIN pick ''; '/',~ jpath '~bin' NB. with J802. cut this line if you
wish to point to downloaded folder
OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i.
To: programm...@jsoftware.com
Cc:
Sent: Saturday, September 6, 2014 1:4
Trees and arrays and simple variables and databases may be represented by
ordinal fractions, see
http://www.statemaster.com/encyclopedia/Ordinal-fraction. That is my favorite
representation of data.
Thanks. Bo.
Den 18:28 lørdag den 6. september 2014 skrev 'Pascal Jasmin' via Programming
:
sslp should be empty, except for windows.
(Actually, that could be expressed more simply but hopefully it's
clear enough this way?)
Thanks,
--
Raul
On Sat, Sep 6, 2014 at 1:55 PM, 'Pascal Jasmin' via Programming
wrote:
> with that info, I've changed 2 lines on wiki:
> sslp =: IFWIN pick ''; '
sslp should be redundant because ~bin where the exe for the windows process
started will automatically in the dll search path.
I think libssl is not a stable api for android. Its path is tricky to
specified even if it is part of the Qt lib runtime. shared objects in
android normally do not have v
It was developed prior to j802, and so providing a hard path option seems still
useful for other J versions on windows.
on adroid, would this be the best result?
OPENSSL=: 'libssl.so'
- Original Message -
From: bill lam
To: Programming forum
Cc:
Sent: Saturday, September 6, 2014 8:1
this is fine but libssl.so is not part of android system library or Qt5
runtime for android.
If you really want it, you need to copy libssl.so under j install folder
inside /data/data and set a explicit path to access that libssl. You may
take a look on the lapack addon for android which use an a
30 matches
Mail list logo