Closed c0gn1tion closed 2 weeks ago
Thanks for reporting this. Unfortunately, I know nothing about NixOS. I wonder if this is a .NET problem on NixOS as there was an issue before about that (#59).
After trying to run the binary with all the dynamic libraries (this being libz and libstdc++), the program works fine
What do you mean by this? That it executes? Which binary are you using or did you build from source?
when trying to generate keys or verify a signature, it gives the error "Illegal Instruction (core dumped)".
Do other commands also produce that error, even stuff like -h|--help
?
Thanks for reporting this. Unfortunately, I know nothing about NixOS. I wonder if this is a .NET problem on NixOS as there was an issue before about that (#59).
Thanks for reading my issue. This probably is a .NET problem, but I compiled binary from source and the problem still persisted. Won't say much about this as I don't know anything about C# or .NET like you with NixOS.
What do you mean by this? That it executes? Which binary are you using or did you build from source?
Basically, running any command that doesn't require any cryptography works such as kryptor -h
or kryptor --version
will work fine, but commands such as kryptor -g
will work fine till it actually starts generating the key, then the error pops up. And what I meant by the 'dynamic libraries', well in NixOS, you cannot run a random binary that you see online because the OS doesn't follow the File system Hierarchy Standard (FHS) and doesn't have a global library path it can use. There are a few ways to get around this, and the one I used was using nix-ld. To find the missing libraries, I used ldd kryptor
and added it to the nix-ld libraries section but even then popped out an error of not having an ICU package (which is needed for proper globalization, don't know if that's needed for Kryptor or not) either way, I then added the ICU package, and then it was able to run help commands as mentioned before, but cryptographical tasks produced errors.
Basically, running any command that doesn't require any cryptography works such as kryptor -h or kryptor --version will work fine, but commands such as kryptor -g will work fine till it actually starts generating the key, then the error pops up.
Thanks for getting back to me. It sounds like it might be libsodium then, the cryptographic library. Not sure where to go from here.
I'd be interested to know whether Cahir or Milva built from source work. The former uses Monocypher and the latter uses Monocypher and Bouncy Castle instead of libsodium.
Sorry for getting back a bit late, had some problems with my computer.
I'd be interested to know whether Cahir or Milva built from source work. The former uses Monocypher and the latter uses Monocypher and Bouncy Castle instead of libsodium.
Well, don't know about Cahir as it has no pre-built binary and I don't know how to compile it, but Milva's binary seems to work out of the box with no issues. So, the problem as you said may lie in libsodium. The libsodium library also seems to be available as a nixpkg, so there should be a way to get it working on NixOS (probably using flakes).
don't know about Cahir as it has no pre-built binary
Sorry, it's still in development and haven't written up build instructions yet.
Milva's binary seems to work out of the box with no issues
Cool, thanks for testing that out.
The libsodium library also seems to be available as a nixpkg, so there should be a way to get it working on NixOS (probably using flakes).
Let me know if you get it working.
I should've said actually that only BLAKE2b uses Monocypher on Milva (e.g., --blake2b-256
). It's less surprising if the other options work because they're either .NET or Bouncy Castle, which means C# code.
I should've said actually that only BLAKE2b uses Monocypher on Milva (e.g.,
--blake2b-256
). It's less surprising if the other options work because they're either .NET or Bouncy Castle, which means C# code.
Just tried the --blake2b-256
hash function and it worked with no issues.
Created a package for Kryptor in nixpkgs: https://github.com/NixOS/nixpkgs/pull/326334
Created a package for Kryptor in nixpkgs: https://github.com/NixOS/nixpkgs/pull/326334
Guess that fixes it then, I will close this issue once it gets merged.
The package is now merged. @samuel-lucas6 maybe you want to add it to the available package managers. If you need any help with nix I'm here :)
Thanks @arthsmn! What link should I use? Searching here doesn't find anything at the moment.
Thanks @arthsmn! What link should I use? Searching here doesn't find anything at the moment.
This is because it was merged on the master branch of the repository, it'll take two or three days to get into nixos-unstable (the rolling release), here is the link of the search in the unstable channel. For the stable release it'll have to wait until the next one, as nixos doesn't add new packages in a stable channel. I'll ping you here when it arrives in unstable.
@samuel-lucas6 kryptor is now in the unstable branch!
@arthsmn Thanks for letting me know. I've updated the website and credited you in the Acknowledgements.
@arthsmn Thanks for letting me know. I've updated the website and credited you in the Acknowledgements.
Thanks!
Description
After trying to run the binary with all the dynamic libraries (this being libz and libstdc++), the program works fine but when trying to generate keys or verify a signature, it gives the error "Illegal Instruction (core dumped)". The missing dynamic libraries was found by running
ldd kryptor
in the directory of the binary.Steps to reproduce
programs.nix-ld.enable = true
programs.nix-ld.libraries = with pkgs; [ libz libstdcxx5 icu ]
./kryptor -g
and select any of the key pair type.Expected behavior
Successfully generate a key pair.
Platform info