secret-key

For RSA, how do i calculate the secret exponent?

半世苍凉 提交于 2019-11-28 09:09:17
For RSA, how do i calculate the secret exponent? Given p and q the two primes, and phi=(p-1)(q-1), and the public exponent (0x10001), how do i get the secret exponent 'd' ? I've read that i have to do: d = e -1 mod phi using modular inversion and the euclidean equation but i cannot understand how the above formula maps to either the a -1 ≡ x mod m formula on the modular inversion wiki page, or how it maps to the euclidean GCD equation. Can someone help please, cheers You can use the extended Euclidean algorithm to solve for d in the congruence de = 1 mod phi(m) For RSA encryption, e is the

How to initialize the Keystore

牧云@^-^@ 提交于 2019-11-27 18:52:48
问题 This my code used for usage of key store to save an arbitrary text as a key in the keystore how I am getting the "Keystore is not initialized error", how can I initialise the Keystore? public void secretKeyGeneration(View view) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); byte[] sek = "eru9tyighw34ilty348934i34uiq34q34ri".getBytes(); SecretKey sk = new SecretKeySpec(sek, 0, sek.length,

Secure keys in iOS App scenario, is it safe?

本小妞迷上赌 提交于 2019-11-27 17:10:41
I am trying to hide 2 secrets that I am using in one of my apps. As I understand the keychain is a good place but I can not add them before I submit the app. I thought about this scenario - Pre seed the secrets in my app's CoreData Database by spreading them in other entities to obscure them. (I already have a seed DB in that app). As the app launches for the first time, generate and move the keys to the keychain. Delete the records from CoreData. Is that safe or can the hacker see this happening and get those keys? *THIRD EDIT** Sorry for not explaining this scenario from the beginning - The

Are breaches of JWT-based servers more damaging?

依然范特西╮ 提交于 2019-11-27 16:57:02
问题 UPDATE : I have concluded my research on this problem and posted a lengthy blog entry explaining my findings: The Unspoken Vulnerability of JWTs. I explain how the big push to use JWTs for local authentication is leaving out one crucial detail: that the signing key must be protected. I also explain that unless you're willing to go to great lengths to protect the keys, you're better off either delegating authentication via Oauth or using traditional session IDs. I have seen much discussion of

Store client secret securely

浪尽此生 提交于 2019-11-27 16:42:43
问题 I know that a public client shouldn't use a client secret because, no matter how much you obfuscate it, it won't be protected from reverse engineering. But, the people in charge of the service I am authenticating to don't want to/can't change it. So, I need to store the client secret and try to protect it from reverse engineering as much as I can. So, I thought of encrypting it using at build time using gradle and store it in a file. Then, when I need it at run time I decrypt it. But now I

Best practices for server-side handling of JWT tokens [closed]

 ̄綄美尐妖づ 提交于 2019-11-27 16:38:38
(spawned from this thread since this is really a question of its own and not specific to NodeJS etc) I'm implementing a REST API server with authentication, and I have successfully implemented JWT token handling so that a user can login through a /login endpoint with username/password, upon which a JWT token is generated from a server secret and returned to the client. The token is then passed from the client to the server in each authenticated API request, upon which the server secret is used to verify the token. However, I am trying to understand the best practices for exactly how and to

How to store a secret API key in an application's binary?

北战南征 提交于 2019-11-27 11:28:49
问题 I am creating a Twitter client for Mac OS X and I have a Consumer secret. It's to my understanding I should not share this secret key. The problem is that when I put it as a string literal into my application and use it, like this: #define QQTwitterConsumerSecret @"MYSECRETYOUMAYNOTKNOW" [[QQTwitterEngine alloc] initWithConsumerKey:QQTwitterConsumerKey consumerSecret:QQTwitterConsumerSecret]; It is in the data section of my application's binary. Hackers can read this, disassemble the

PBKDF2WithHmacSHA512 Vs. PBKDF2WithHmacSHA1

最后都变了- 提交于 2019-11-27 10:33:49
问题 I'm working on a Java authentication subsystem that specs the storage of passwords in the DB as PBKDF2 -generated hashes, and I'm now trying to decide whether I should use SHA1 or SHA512 as PFR. I went through the specs of both but they are very mathematically intensive for me to follow. Can somebody with better crypto-understanding explain how PBKDF2WithHmacSHA512 differs from PBKDF2WithHmacSHA1 ? Here's what I'm trying to do: private static final int HASH_BYTE_SIZE = 64; // 512 bits private

How do API Keys and Secret Keys work? Would it be secure if I have to pass my API and secret keys to another application?

自作多情 提交于 2019-11-27 08:56:56
问题 I am just starting to think about how api keys and secret keys work. Just 2 days ago I signed up for Amazon S3 and installed the S3Fox Plugin. They asked me for both my Access Key and Secret Access Key, both of which require me to login to access. So I'm wondering, if they're asking me for my secret key, they must be storing it somewhere right? Isn't that basically the same thing as asking me for my credit card numbers or password and storing that in their own database? How are secret keys

when you have secret key in your project, how can pushing to GitHub be possible?

感情迁移 提交于 2019-11-27 06:54:58
I am trying to push a brand new, empty Rail 3.0.4 project to GitHub, but just realize that the cookie session store has a secret key: In config/initializers/secret_token.rb NewRuby192Rails304Proj::Application.config.secret_token = '22e8...' So how can we avoid it being push to GitHub? We can ignore this file (using .gitignore ), but without this file, a Rails app won't run at all (and is not a complete Rails app). Or in general, other files or frameworks may have files containing secret keys too. In such case, how should it be handled when pushing to GitHub? VonC Add in your repo: a template