I am using GetASyncKeyState (C++) to check for keys.
I don't know what the name of this key is:
How is this key named? What is the VK_ or Scancode?
VK_LMENU : Left menu key (0xA4)
VK_RMENU : Right menu key (0xA5)
Source has many more interesting keys I didn't even know that exist, such as "right windows key" o.O
Apparently, this key is reported by VK_APPS
VK_APPS is an extended key and its scan code is D5E0 (D5E1 on some systems). More on Windows key maps here.
Related
Control-M's ISPF client in zOS (mainframe) comes with a set of predefined values assigned to PF keys (function keys), such as:
PF2 = SPLIT
PF9 = SWAP
However, similar to other ISPF applications, I'd like to change the values of those PF keys (and a few others, such as PF2 = RETURN) like so:
PF2 = SPLIT NEW
PF9 = SWAP NEXT
And trying to use standard ISPF's primary command "PFKEYS" "KEYS" (typo, pointed out in first answer), via which you can adapt the values of your PF keys, doesn't seem to work for Control-M either (you only get error message "UNRECOGNIZED COMMAND", no matter on which screen you try this command).
Any suggestions about how to change those values for PF2 and PF9 anyhow?
PFKEYS is not a valid ISPF command. The proper commands to access the ISPF PF Key Definitions and Labels dialog are KEYS for context sensitive key assignments or ZKEYS for global key assignments.
Navigate into Control-M, then use the KEYS command to launch the dialog and assign the desired function key commands. You may need to explicitly enter the SAVE command to commit your key assignment changes to your profile (although PF3 should invoke an END, which includes a SAVE).
Subsequently, PFSHOW (or the short version, FKA) will add an "infobar" of sorts to your panel that shows the PF keys, and either the defined label or the first 8 chars of the command that is currently assigned to each function key. Enter PFSHOW OFF (or FKA OFF) to remove this display.
The KEYLIST ON/OFF command can be used to switch between default and custom key assignments for some product panels. Enter the KEYLIST command with no arguments to see if options are available. FWIW... I don't have access to Control-M, but our installation of other BMC products does not include custom keylists.
Some PFkey errors can be attributed to installation procedures that do not include the appropriate members in logon procs. For Control-M, these members appear to be CMTCMDS and/or CMTUCMDS. The sysadmins responsible for installing the product would likely need to address this type of issue. However, the issue described here provides no indication of an installation problem.
I want to map windows/super keyboard key in my xboxdrv config but KEY_SUPER or KEY_WINDOWS doesn't work. what is the EV_KEY name of the "super" key? (I mean key with windows logo on many keyboards)
Either KEY_LEFTMETA or KEY_RIGHTMETA.
You can find it out using evtest, for example:
$ evtest /dev/input/event1
Once you press the button you are looking for, you should see something like this:
Event: time 1477389229.423141, type 1 (EV_KEY), code 126 (KEY_RIGHTMETA), value 1
I recently had to convert challenge questions and passwords for an OpenAM implementation.
The plan was to convert these values as part of the user entry in a LDIF file and load it. The attribute to complete is iplanet-am-user-password-reset-question-answer. This is a multi valued attribute to support multiple question/answer pairs.
The challenge question key, answer and question key and question status flag had to be combined in a single line delimited by tabs.
[question-key]\t[answer]\t[1|0]
The value needs to be encrypted. This was the class used to encrypt but it did not work.
AMPasswordUtil().encrypt(question.get(challenge) + "\t" + response + "\t1")
What to do to make this work?
Finally gave up and dropped ForgeRock support a question. They were very helpful and supplied the solution and it worked immediately. Here it is...
It turns out the AMPasswordUtil class should not be used. Instead this should be used
encrypted_str = AccessController.doPrivileged(new EncodeAction( clear_text_str ))
The encryption key needs to be set as a system property
System.setProperty("am.encryption.pwd", key );
The encryption key can be retrieved from OpenAM.
How can I safely store sensitive data online?
I want to store some extremely sensitive information online in a public folder, and I'm not sure how to go about it.
Specifically, I want to store bitcoin private keys in a .json file named "walletData.json" in a public folder. The file contains the wallet address and public key in plain text, along with an encrypted version of the private key.
Assuming anyone can access the file and attempt to crack the encryption password with their "super computers", what's the best way to safely encrypt that private key?
I know a longer password would be a good start, but ideally I don't want to need a password longer than 10 characters.
I was thinking of maybe hashing the password 1000 times, then using that hash+password as an AES encryption key. But, as everyone can see the key generation method, i'm not sure that will help? I was also thinking of padding out the encrypted private key with some other random data, but again, I don't know if it'll really help??
Is there a safe way to do this?
EDIT - after Reid's answer:
I'm trying to do this 100% in Javascript/jQuery.
When I export a CoinPrism.com wallet, I get this:
{"keys":[{"addr":"1PNLiLgW2fBokCB2wmfhZTtbmioitkqtMm","priv":"172655af193edeb54467a52fc6eb94c67eeeff8cd03555767e5cf12df694bb88f9c8b25c4019147d9e4993405274c96a","encryptionMode":"PKBDF2-SHA256","iterations":2000}],"salt":"2222b67fc7255aaf0b4027bfcabffb5e62f39e9e0aa13e8ad70f2dc75a484f26"}
The "priv" value is an encrypted private key. I don't know exactly how it's encrypted, but i'm sure that there's a way to decrypt it using just my 10 character password.
Does anyone know how they're doing this?
Is it safe to store this information online?
Well, I will just say outright that you don't need to be the one who writes the code to do this — it is far too easy to mess up, and your post makes suggestions that are concerning. (For instance, you describe something of an ad-hoc key derivation scheme, but one that is insufficient in protection.)
So, you need a library of some kind to handle this business for you.
My suggestion: Use GPG with the ASCII armor option. For example:
gpg --symmetric --armor --cipher-algo AES file.txt
This will symmetrically encrypt (--symmetric) a file (file.txt here) using the AES cipher (--cipher-algo AES) and store the resulting encrypted file in an ASCII armored format (--armor). Note: the resulting encrypted file will be stored in the filename plus the extension .asc; e.g., here, it puts the result in file.txt.asc. You can change this with the --output option.
Now, the above command will prompt you for a passphrase — this passphrase needs to be very strong, far more than 10 characters I'm afraid. This is the burden of passphrase-based encryption: you need passphrases that are strong. Ideally, you want a passphrase that is long and complicated, hard-to-guess and hard-to-bruteforce.
Since we are on StackOverflow, you may be looking to automate the passphrase entry (using scripting). To do that, there are several --passphrase related options for GPG. For example,
gpg --batch --passphrase "test" --symmetric --armor --cipher-algo AES file.txt
will use the passphrase test instead of prompting the user. Command line arguments are not safe, however, on a system, so it would be better to use the --passphrase-from-file option, which takes a single file as an argument. The first line of that file is the passphrase to be used.
How to get private key with asn format from pfx? I need to get the private key with asn format to put to Qt's variable QSslKey to connect https server.
I have to use Win32 Api to do it, and I can't use OpenSSL to transform it.
First I try to get the private key directly:
1.CertOpenSystemStore(NULL, _T("MY"))
2.CryptAcquireCertificatePrivateKey(...)
3.CryptGetUserKey(...)
4.CryptExportKey(...)
But the private key I have got, I don't know how to use it.
Warning : This is not the exact answer for your question, but i hope it will give you some help towards what you want to acheive
Based on my experience, Windows crypto APIs are designed to use the private key within the certificate store rather than export the key outside, unless you are using CryptoAPI standard functions like PFXExportCertStoreEx ().
CryptExportKey function gives the private/public key pair in a key blob structure which you have to convert to the format you want. The closest thing i have ever seen this being being done is in
Openssl engine for Windows, filename : e_capi.c
refer to the function
**capi_load_privkey() and subfunction capi_get_pkey()**
Here conversion of the Key blob to OpenSSL compatible structure is done.
Hope this helps