Public key algo pascal only

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

Public key algo pascal only

José Mejuto
Hello,

Is there any public/private key algorithm, pascal only, implemented in
the distribution of fpc ? Degree of security is not important, also a
3rd party unit which does not depends on a DLL or depends on another
software to generate key pairs, or other tasks, would be valid too.

Thank you.

--

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Public key algo pascal only

Michael Van Canneyt


On Fri, 5 Apr 2019, José Mejuto wrote:

> Hello,
>
> Is there any public/private key algorithm, pascal only, implemented in
> the distribution of fpc ? Degree of security is not important, also a
> 3rd party unit which does not depends on a DLL or depends on another
> software to generate key pairs, or other tasks, would be valid too.

Not to my knowledge. All solutions use gnutls or openssl.

I know of TMS Crypto, but it also uses .obj files that were generated using C, as
far as I know.

Maybe DCrypt has the necessary routines, Graeme Geldenhuys maintains a
version that works with FPC.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Public key algo pascal only

José Mejuto
El 05/04/2019 a las 13:01, Michael Van Canneyt escribió:

> Maybe DCrypt has the necessary routines, Graeme Geldenhuys maintains a
> version that works with FPC.

Hello,

Thank you, I have code from DCrypt but I was looking for something much
more simple which can generate the keys/certificates and handle all
operations or at least sign/check-sign, even a 32 bits algo would be
valid :-)

Anyway thank you, your answer confirms my suspects.

--

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Public key algo pascal only

Виктор Матузенко

пт, 5 апр. 2019 г. в 14:17, José Mejuto <[hidden email]>:
El 05/04/2019 a las 13:01, Michael Van Canneyt escribió:

> Maybe DCrypt has the necessary routines, Graeme Geldenhuys maintains a
> version that works with FPC.

Hello,

Thank you, I have code from DCrypt but I was looking for something much
more simple which can generate the keys/certificates and handle all
operations or at least sign/check-sign, even a 32 bits algo would be
valid :-)

Anyway thank you, your answer confirms my suspects.

--

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


--
Victor Matuzenko (Виктор Матузенко)

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Public key algo pascal only

José Mejuto
El 05/04/2019 a las 19:08, Виктор Матузенко escribió:
> Hi,
>
> try this https://github.com/delphi-pascal-archive/Pascal-RSA
>

Hello,

Thank you. It is a bit "monster" but maybe I can split the necessary
code. Thank you again.

--
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Public key algo pascal only

Jy V
In reply to this post by José Mejuto

---------------------------------
On Friday, April 5, 2019, José Mejuto wrote:
> Is there any public/private key algorithm, pascal only, implemented in the distribution of fpc ? Degree of security is not important, also a 3rd party unit which does not depends on a DLL or depends on another software to generate key pairs, or other tasks, would be valid too.
---------------------------------

Give a look at Crypto.pas in Ultibo project at github, from memory it requires very few other pascal unit (and of course no external library or obscure binary code)

I also know that XMLRAD is sharing similar feature in unit XCrypto.pas, the project is hosted at SourceForge (and still of course no external library or obscure binary code).


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Public key algo pascal only

José Mejuto
El 07/04/2019 a las 8:22, Jy V escribió:
> Give a look at Crypto.pas in Ultibo project at github, from memory it
> requires very few other pascal unit (and of course no external library
> or obscure binary code)
>
> I also know that XMLRAD is sharing similar feature in unit XCrypto.pas,
> the project is hosted at SourceForge (and still of course no external
> library or obscure binary code).

Hello,

Thank you, I'll put an eye on both of them.


--

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Public key algo pascal only

Santiago A.
In reply to this post by José Mejuto
El 06/04/19 a las 19:26, José Mejuto escribió:

> El 05/04/2019 a las 19:08, Виктор Матузенко escribió:
>> Hi,
>>
>> try this https://github.com/delphi-pascal-archive/Pascal-RSA
>>
>
> Hello,
>
> Thank you. It is a bit "monster" but maybe I can split the necessary
> code. Thank you again.

There is no simple solution for a complex problem.
RSA implies a lot of backend: several symmetric ciphers (AES,
Blowfish..., that are complex by their own. You don't want to use Caesar
cypher), acceptable random generator, big integer arithmetic,  prime
numbers,  several hash algorithms.
And the library is leaving aside all PKI stuff: certificates,
authorities  etc. And forget about memory protection etc
I think it is a minimal RSA lib. In fact, maybe it's too simple. As far
as I've seen it only has MD5 and SHA1 hash algorithms, many environments
require at least sha256. But if it is only for internal use (you are in
charge of both ends of communication) and not for critical top secret,
it could be enough. I don't think you will find anything much more simpler.

--
Saludos

Santiago A.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Public key algo pascal only

Jy V


On Mon, Apr 8, 2019 at 11:58 AM Santiago A. <[hidden email]> wrote:
There is no simple solution for a complex problem. I don't think you will find anything much more simpler.

Santiago, you should reconsider, the original poster asked for PublicKey/PrivateKey algorithm,
in ECC.pas from XMLRAD hosted at SourceForge the unit is 1K line of pure pascal,
this unit provide essential elements with 4 functions, it may give you ideas how simple it could be while providing ECDSA256 (secp256r1) which the de-facto high security standard as-of april 2019:

function EccMakeKey(out PublicKey: TPublicKey; out PrivateKey: TPrivateKey): Boolean;
function EcdhSharedSecret(const PublicKey: TPublicKey; const PrivateKey: TPrivateKey; out Secret: TEccSecretKey): Boolean;
function EcdsaSign(const PrivateKey: TPrivateKey; const Hash: TEccHash; out Signature: TSignature): Boolean;
function EcdsaVerify(const PublicKey: TPublicKey; const Hash: TEccHash; const Signature: TSignature): Boolean;


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Public key algo pascal only

José Mejuto
In reply to this post by Santiago A.
El 08/04/2019 a las 11:49, Santiago A. escribió:

> There is no simple solution for a complex problem.
> RSA implies a lot of backend: several symmetric ciphers (AES,
> Blowfish..., that are complex by their own. You don't want to use Caesar
> cypher), acceptable random generator, big integer arithmetic,  prime
> numbers,  several hash algorithms.
> And the library is leaving aside all PKI stuff: certificates,
> authorities  etc. And forget about memory protection etc
> I think it is a minimal RSA lib. In fact, maybe it's too simple. As far
> as I've seen it only has MD5 and SHA1 hash algorithms, many environments
> require at least sha256. But if it is only for internal use (you are in
> charge of both ends of communication) and not for critical top secret,
> it could be enough. I don't think you will find anything much more simpler.

Hello,

For serious stuff complex libraries are needed, I know, but in this case
a simple algo like a XOR (if it was a public/private key one) would be
enough. The only requirement is that the "client" can not generate
easily commands so the generation key must not be compiled in the code.
It is not a security algo, it's more like make it difficult and nothing
more, no real security is broken if the choose code is broken.


--

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal