keygen | KeyGen is a generator for keys and passwords | Cryptography library
kandi X-RAY | keygen Summary
kandi X-RAY | keygen Summary
KeyGen is a generator for keys and passwords. It's usable as standalone application and library. The cryptography behind is provided by OpenSSL.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of keygen
keygen Key Features
keygen Examples and Code Snippets
const int KEY_LENGTH = 100000; // Key length
uint8_t* buffer = malloc(KEY_LENGTH * sizeof(uint8_t)); // allocate buffer
if( buffer == NULL )
{
// Error - malloc() failed
}
else
{
KeyGenError err = keygen_createKey(buffer, KEY_LENGTH, ASCII);
Usage: keygen [Options]
--ascii -a : Generates a key of ASCII characters, ranging from '!' to'~' (default)
--ascii-blank -w : Generates a key of ASCII characters, ranging from ' ' to'~';
same as --ascii, but includes b
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This prog
Community Discussions
Trending Discussions on keygen
QUESTION
Trying to integrate a new TeamCity project with an existing git-bitbucket repo.
I am a rather limited user on our TeamCity platform (on-prem, 2017.1.3-46961). I do not have access to the actual server file system, I am using the web interface, instead.
Created an SSH key pair on my laptop with ssh-keygen -t rsa -m PEM
In our TeamCity, I uploaded the SSH key (private side):
However, when trying to set up my VCS root with that key, I cannot see it in the drop-down:
This VCS Root is in the project where the SSH key has been uploaded. Should have I uploaded the key somewhere else?
Or, maybe, this is a TeamCity bug? I tried basic shake-up like hard-refreshing the page, logging out/in...
...ANSWER
Answered 2021-Jun-12 at 13:39Even though the VCS root was created in the specific project, it somehow belongs to
. Once I added the SSH key in the root project, it was available for selection in the dropdown above and connection test to bitbucket has passed.
QUESTION
I'm trying to clone a repo from Gitlab.com via ssh. But I get this error all the time:
...ANSWER
Answered 2021-Jun-09 at 05:07It depends on what you used for the $keyFile
in your script.
A default name should be part of the /home/pi/.ssh/id_xxx
names considered during an SSH session.
But a non-default name would need to be specified in an ~/.ssh/config
: double-check if you have one.
Also, in your script, to be sure, don't use ~/.ssh,
but /home/$USER/.ssh
consistently, to avoid any mistake when the shell substitutes ~
.
QUESTION
Why I allways get the "key is invalid" error in the simple code bellow. I already tried to use different private keys with the same result. Please help me cause I have no more ideas what i am doing wrong.
...ANSWER
Answered 2021-Apr-06 at 15:10The RSA family algorithms expect a key of type *rsa.PrivateKey
. The library dgrijalva/jwt-go
has a helper function jwt.ParseRSAPrivateKeyFromPEM(keyData)
where keyData
is a []byte
slice.
The repo has some handy examples in rsa_test.go file.
Also the examples are outdated because as of Go 1.16 the ioutil
package is deprecated...
Please be aware that github.com/dgrijalva/jwt-go
has been unmaintained for a long time and has critical unfixed bugs. And doesn't support Go modules, before the version 4 (which is just a preview anyway). I strongly recommend to choose an different library for dealing with JWT.
QUESTION
Suppose I create a key using R's cyphr library
...ANSWER
Answered 2021-May-31 at 02:21One option is split the string at the space with strsplit
, loop over the list
of values, convert to raw
through hexmode
QUESTION
I ssh to a device that gets attached to a test bench with the following:ssh root@1.2.3.4
Because the actual device has been changed since the last time I connected to that IP I get:WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
all as expected. The warning tells me that I can easily fix this with ssh-keygen -f "/home/myuser/.ssh/known_hosts" -R "1.2.3.4"
I do find it repeating the same thing over and over, there must be some way to improve this. I know this IP and it is internal to my company.
I started working on trying to use something like !!:s/find/replace
but the spaces in the replace is making my life difficult.
What is the easiest way to automate this, maybe create an alias?
Thank you Jack
...ANSWER
Answered 2021-May-26 at 19:18I asked a senior dev at my company and he suggested that I just update my ~/.ssh.config file. I added:
QUESTION
after buying a Yubikey 5 NFC for technical interest (firmware 5.2.7) and setting up FIDO2 authentication where possible, I ran into the problem that I could no longer connect to my GitLab server via SmartGit because the second factor is not requested and therefore I can't connect to the server.
I then decided to deal with it on Windows 10 via Git Bash and SSH. Unfortunately, the documentation here assumes a lot of prior knowledge and I am an absolute beginner on the subject. In the meantime I managed to connect to the server with Git Bash and SSH using a locally generated SSH certificate.
Now I would like to use the Yubikey instead of the certificate stored locally on the computer. Unfortunately, all instructions (e.g. this one https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key-for-a-hardware-security-key) lead to the same error message for me:
...ANSWER
Answered 2021-May-23 at 07:03So: it is true Security keys are now supported for SSH Git operations , as announced early this month (May 2021) on GitHub, but, as discussed here, there are still issues.
Your error message looks like a bug in progress on Debian: "issue 980393: /usr/bin/ssh-keygen -t ecdsa-sk
fails with "Key enrollment failed: invalid format"".
And it is still being reported this month.
If this fails also with -t ecdsa
, try and using a plugin for OpenSSH to connect to FIDO/U2F security keys through native Windows Hello APIs might help.
Type export SSH_SK_HELPER=/usr/lib/ssh/ssh-sk-helper.exe
first, as seen in tavrez/openssh-sk-winhello
issue 1.
Check your OpenSSH version is at least 8.2. It is on my side with the latest Git for Windows:
QUESTION
I have a personal github account and then another for work. My Directory structure:
...ANSWER
Answered 2021-May-23 at 03:45You'll probably want to use both includeIf
and carefully-adjusted URLs.
To see how this works (plus various Git version caveats), read through the long section.
LongWe need to separate things into two parts here. First, let's describe it: what program uses what, when, and how. Then let's worry about how to use these conveniently.
There's the stuff Git uses when you run
git commit
. This is whatuser.name
anduser.email
are for.1Then, independent of any of that, there's the stuff that ssh uses when you run
git fetch
orgit push
with anssh://git@github.com/path/to/repo.git
orgit@github.com:path/to/repo.git
URL.2
You configure Git settings with git config
. You configure ssh settings by editing files in $HOME/.ssh/
, or wherever your system's ssh, or the auxiliary ssh, puts them.3
Let's now dive into the ssh part.
1Whenever you make a new commit with Git, Git needs to know several things to put into the new commit:
- Your name, e.g., "A. U. Thor".
- Your email address, e.g.,
thor@example.com
. - The current date-and-time.
- A log message.
- A snapshot: the exact contents for every file, to put into the new commit.
Git finds the date-and-time on its own, using your computer's clock. Use whatever software is appropriate to keep your computer's clock correct to make this work right.
Git gets the log message from you. Use whatever you like to provide the right log message.
Git gets the snapshot from whatever is in Git's index. Use git add
to adjust Git's index, so that you have the correct snapshot. (This is why you have to git add
files all the time, even if they're not new files: it's not that Git isn't going to put them in the commit, it's that Git will put the old version in the file, because when Git checked out a commit earlier, that's the version it got out of the commit, and put in Git's index. The git add
command has Git update its index copy of the file.)
The user.name
and user.email
settings are just for these items: author/committer name, and author/committer email address. You can put anything you want here; Git does not know or care who you are, and does not verify these. (Other software may, eventually, try to figure out who you are, and might care, so it's generally just a loss to you if you fake these, but Git itself won't care.)
2I've written these as git@github.com
but you can use just github.com
, or something even shorter, depending on how you configure ssh itself. See the section on ssh below. The github.com:path
spelling is shorter and has the same effect as ssh://github.com/path
, but I prefer the explicit ssh://
myself. They really do mean the same thing to Git—not to ssh, but Git strips this part off before invoking ssh—so you can use whichever you prefer here.
3On systems that come with a working ssh, Git generally just uses the system's ssh. On Windows, however, a lot of older Windows systems have either a defective ssh, or no ssh at all, so a lot of Git-for-Windows installations come with a private ssh implementation as well. You must find out which ssh your system uses, if you are in this situation, and see where to configure it. You may be able to configure your Git to use the system ssh; if you have a modern Windows system, this may be a good idea. I don't use Windows and hence don't have all the details here.
How ssh works, in a nutshellWhile ssh has lots of little side jobs to perform, its one big thing is to establish a secure communications stream. To do this, ssh needs to authenticate. For our purposes here, we'll skip over all but the simple public/private-key authentication method, and in particular how GitHub will decide who you are. This lets us ignore a lot of irrelevant-to-us details. (They do matter if you're using ssh more generally, but not if you're fetching from, and pushing to, GitHub.)
What ssh will do is:
- look up a host name to find an IP address, or take an IP address directly;
- connect to a server at that IP address, at some numeric port (default 22, which is the standard ssh port);
- collect a "fingerprint" from the server there, and see if it matches the known fingerprint from the last connection;4
- if all looks good, send enough information for the other end to figure out who you are: they'll send a challenge, your ssh will send a response, and at the end of all of this, they will have your public key and be reasonably certain that you have the corresponding private key.
In the end, then, they figure out who you are from your public key. They don't believe you just because you have this key: the public key is, after all, available to the public. But this particular public key is paired with a private key, which you don't give out to anyone else. They send a challenge, using your public key that you've already sent to them, and you—or your ssh—answer back, using your private key, and the fact that you can respond indicates that you hold the right private key.
What all this boils down to is:
You must give GitHub your public key, using their web interface. This is how they will decide that you are you. If you want to be two people, "you-at-home" and "you-at-work", you need to give them two public keys.
Later, when you come in to access some particular repository, you must give GitHub the right public key. You don't give them just any public key: if you want access to "you-at-work" repositories, you have to give them the you-at-work public key (only!).
So: how do we do that? If you have two (or more) public keys, how do we make sure that ssh hands, to GitHub, one particular key? This is where the .ssh/config
entries come in. Let's look at this one:
QUESTION
I have followed these instructions for generating keypairs using ssh-keygen. I actually generated both the ed25519 and an rsa key as I attempted to figure out what was wrong.
I copied and pasted the public key pair for both of these keys in gitlab according to their instructions.
when I enter: ssh -T git@gitlab.com
it says:
client_global_hostkeys_private_confirm: server gave bad signature for RSA key 0
but it also says Welcome to gitlab, @my_username!
when I try to push to my repo, I get a popup asking for my gitlab username and password which I enter and which fails.
I don't understand why it is prompting me for a username and password considering that I have attempted to establish SSH keypairs for authentication.
Any advice is appreciated
...ANSWER
Answered 2021-May-17 at 17:26I get a popup asking for my gitlab username and password which I enter and which fails.
Check, as commented:
git remote -v
git config credential.helper
If the first starts with https://
, and the second is not empty, what you see is a Git credential helper trying to cache your HTTPS credentials.
That means your SSH key would be ignored anyway.
Regarding the error message, check out this thread, and test it with:
QUESTION
I have two Raspberry Pies which I use to connect to the same web host. SSH works fine on both machines, but curl SFTP works on one but not the other. How do I fix this?
Fails here:
...ANSWER
Answered 2021-May-12 at 05:42The known_hosts
file on the raspmountain
probably does not contain the hostkey of the server.
You will for sure get more details in curl log.
QUESTION
I'm trying to use git push
with SSH remote from GitHub CI action and get an error: Load key "/tmp/341b5794-f0a2-4534-90dd-f791510ec77a_id_rsa": invalid format
Key is in repository secret. I get its info with ssh-keygen -l -v -f key_id_rsa
and its output equals to output on my local machine. From my machine I can push with this key
ANSWER
Answered 2021-May-03 at 06:48If the private key format differs, that means, as I mentioned here that:
- one platform is using openssh prior to 7.8, with an old PEM 64-chars per line format.
- one is using a more recent OpenSSH format, 70-chars per line.
You can force a recent openSSH to generate the old format with:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install keygen
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page