Recent

Author Topic: [Solved] Package Laz_Synapse  (Read 369 times)

Aruna

  • Sr. Member
  • ****
  • Posts: 494
[Solved] Package Laz_Synapse
« on: October 04, 2024, 11:20:20 pm »
I am following the instructions on the wiki here on Synapse

I downloaded and extracted the zip into my lazarus/components folder but I do not see it when trying to install it using Package--->Install/Uninstall Package so I loaded up the *.lpk file and compiled everything, that went ok. But when I try to install the option is greyed out and all that is available to me is 'add to project' ? Attached screenshot shows this.

So my questions are:
1 - How do I enable the install option in Synapse?
2 - What exactly does 'add to project' do? And how do I use it once added?
3 - Have I done something incorrectly?
« Last Edit: October 05, 2024, 12:39:23 am by Aruna »

Fibonacci

  • Hero Member
  • *****
  • Posts: 570
  • Internal Error Hunter
Re: Package Laz_Synapse
« Reply #1 on: October 05, 2024, 12:22:17 am »
1. Package -> Open Package File (.lpk)
2. select your .lpk
3. window will show, click Use -> Add to Project
4. package will appear in "Project Inspector" in "Required Packages"
5. Just use

Code: Pascal  [Select][+][-]
  1. program Project1;
  2.  
  3. uses SysUtils, synacrypt;
  4.  
  5. function tohex(p: pointer; l: dword): string;
  6. var
  7.   i: integer;
  8. begin
  9.   result := '';
  10.   for i := 0 to l-1 do result += inttohex(pbyte(p+i)^, 2);
  11.   result := lowercase(result);
  12. end;
  13.  
  14. var
  15.   aes: TSynaAes;
  16.   s: string;
  17.  
  18. begin
  19.   aes := TSynaAes.Create('keykeykeykeykeyx');
  20.   aes.SetIV('ivivivivivivivix');
  21.   s := aes.EncryptCTR('test');
  22.   aes.Free;
  23.   writeln('encrypted = ', s);
  24.   writeln('   as hex = ', tohex(@s[1], length(s)));
  25.   writeln('     valid? ', tohex(@s[1], length(s)) = '92e6d159');
  26.   writeln;
  27.  
  28.   aes := TSynaAes.Create('keykeykeykeykeyx');
  29.   aes.SetIV('ivivivivivivivix');
  30.   s := aes.DecryptCTR(s);
  31.   aes.Free;
  32.   writeln('decrypted = ', s);
  33.  
  34.   readln;
  35. end.

And it works and here is the proof:
https://gchq.github.io/CyberChef/#recipe=AES_Encrypt(%7B'option':'UTF8','string':'keykeykeykeykeyx'%7D,%7B'option':'UTF8','string':'ivivivivivivivix'%7D,'CTR','Raw','Hex',%7B'option':'Hex','string':''%7D)&input=dGVzdA
:D
« Last Edit: October 05, 2024, 12:25:01 am by Fibonacci »

Aruna

  • Sr. Member
  • ****
  • Posts: 494
Re: Package Laz_Synapse
« Reply #2 on: October 05, 2024, 12:38:44 am »
1. Package -> Open Package File (.lpk)
2. select your .lpk
3. window will show, click Use -> Add to Project
4. package will appear in "Project Inspector" in "Required Packages"
5. Just use
Thank you so much @Fibonacci. I have attached a screenshot :-)

And it works and here is the proof:
https://gchq.github.io/CyberChef/#recipe=AES_Encrypt(%7B'option':'UTF8','string':'keykeykeykeykeyx'%7D,%7B'option':'UTF8','string':'ivivivivivivivix'%7D,'CTR','Raw','Hex',%7B'option':'Hex','string':''%7D)&input=dGVzdA
:D
Now this looks very interesting and useful. How on earth did you manage to find this? Thank you again for sharing  :)

Aruna

  • Sr. Member
  • ****
  • Posts: 494
Re: [Solved] Package Laz_Synapse
« Reply #3 on: October 05, 2024, 12:41:44 am »
Hi @Fibonacci I am trying to build my own IRC client. Would you have any code I could use, please? OR ideas on how best to proceed?

Fibonacci

  • Hero Member
  • *****
  • Posts: 570
  • Internal Error Hunter
Re: Package Laz_Synapse
« Reply #4 on: October 05, 2024, 03:40:50 am »
And it works and here is the proof:
https://gchq.github.io/CyberChef/#recipe=AES_Encrypt(%7B'option':'UTF8','string':'keykeykeykeykeyx'%7D,%7B'option':'UTF8','string':'ivivivivivivivix'%7D,'CTR','Raw','Hex',%7B'option':'Hex','string':''%7D)&input=dGVzdA
:D
Now this looks very interesting and useful. How on earth did you manage to find this? Thank you again for sharing  :)

This is a well known tool ;) There are others, but this on makes a nice links so you can share your recipe

Hi @Fibonacci I am trying to build my own IRC client. Would you have any code I could use, please? OR ideas on how best to proceed?

Here is fully working IRC client for FPC, ready to compile. I checked, it works:

https://github.com/parmaja/miniIRChat

Aruna

  • Sr. Member
  • ****
  • Posts: 494
Re: Package Laz_Synapse
« Reply #5 on: October 10, 2024, 12:31:21 am »
Here is fully working IRC client for FPC, ready to compile. I checked, it works:
https://github.com/parmaja/miniIRChat
Thank you @Fibonacci. I actually chatted with the person who wrote that on IRC #pascal his nickname is Zaher.

 

TinyPortal © 2005-2018