nonce

How to use salsa20 counter nonce?

断了今生、忘了曾经 提交于 2019-12-08 07:47:27
I am not sure if I got it right: a counter of messages can be used as/instead of the nonce? I mean a message like this: Header(2bytes) | counter(8bytes) | Body(n bytes encrypted) | HMAC-SHA1 with counter = 1 (63 of the bits=0) is ok? I understand that I should never use the same key with the same nonce twice. What do I do when a new connection is started and counter starts from 1 again? Artjom B. I understand that I should never use the same key with the same nonce twice. What do I do when a new connection is started and counter starts from 1 again? If you re-use a nonce with the same key,

Can I validate HTTP request signature tokens and nonces using Model Binding?

有些话、适合烂在心里 提交于 2019-12-08 02:51:28
问题 I am setting up an end-point using ASP.NET MVC to which requests can be made to manipulate and retrieve data (basically, an API). I am using a 2-legged OAuth model to validate that requests be signed using a secret key and signing method as well as a nonce table to prevent hi-jacking. Since Model Binding is so handy in ASP.NET MVC I am going to take advantage of it to consume requests, but I wonder if I can bake the signature verification and nonce/timestamp handling right into the model

Android InApp Billing - what are really nonces for?

随声附和 提交于 2019-12-04 12:44:53
问题 YES, I've read all the docs @ developer.android.com and I do understand it all with one basic exception - what it was introduced for. Since all order responses from Google Play come signed by inaccessible-by-anyone private key and are being verified by paired public key (in my case on external server, so it is also inaccessible for third person) there's simply (almost) no way to spoof. All those nonces are just redundant way of securing the purchases. And what's more, the docs say nothing

How to handle the IV/Nonce/Counter for AES CTR?

瘦欲@ 提交于 2019-12-03 20:41:53
import javax.crypto.Cipher; public abstract class Crypto { private static final String CIPHER_ALGORITHM = "AES/CTR/NoPadding"; private String AesKeyString = "ByWelFHCgFqivFZrWs89LQ=="; private void setKey() throws NoSuchAlgorithmException{ byte[] keyBytes; keyBytes = Base64.getDecoder().decode(AesKeyString); aesKey = new SecretKeySpec(keyBytes, "AES"); } protected byte[] execute(int mode, byte[] target, byte[] iv) throws Exception{ Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); IvParameterSpec ivSpec = new IvParameterSpec(iv); cipher.init(mode, aesKey, ivSpec); return cipher.doFinal

nonce usage in authentication

a 夏天 提交于 2019-12-03 11:49:10
问题 In digest based authentication, nonce is generated by server. However in OAuth based authentication, nonce is generated by client. I want to know if anyone knows the reason for the difference? 回答1: Nonces are used to make a request unique. In an authentication scheme without a nonce, a malicious client could generate a request ONCE and replay it MANY times, even if the computation is expensive. If the authentication schema requires the client to perform expensive computation for every single

How does check_ajax_referer() really work?

大兔子大兔子 提交于 2019-12-03 08:57:21
Smart Wordpress people say that plugin developers should employ a nonce in each AJAX request that is sent from a page back to the wordpress blog (admin-ajax.php). This is done by (1) generating a nonce on the server side, via $nonce = wp_create_nonce ('my-nonce'); ...(2) making that nonce available to Javascript code that sends AJAX requests. For example you could do it like this: function myplg_emit_scriptblock() { $nonce = wp_create_nonce('myplg-nonce'); echo "<script type='text/javascript'>\n" . " var WpPlgSettings = {\n" . " ajaxurl : '" . admin_url( 'admin-ajax.php' ) . "',\n" . " nonce :

Android InApp Billing - what are really nonces for?

喜你入骨 提交于 2019-12-03 08:06:06
YES, I've read all the docs @ developer.android.com and I do understand it all with one basic exception - what it was introduced for. Since all order responses from Google Play come signed by inaccessible-by-anyone private key and are being verified by paired public key (in my case on external server, so it is also inaccessible for third person) there's simply (almost) no way to spoof. All those nonces are just redundant way of securing the purchases. And what's more, the docs say nothing about the situation, when: I purchase an item; Generate nonce and send it to Google Play; Have a crash, so

Enabling SSL in ASP.NET MVC 5 app results in OpenIdConnectProtocolValidator issue

大城市里の小女人 提交于 2019-12-03 07:24:39
问题 I have an ASP.NET MVC 5 app that authenticates against Azure Active Directory. I wanted to enable SSL on it across the app. and hence leveraged global filters as follows: public class FilterConfig { /// <summary> /// Registers the global filters. /// </summary> /// <param name="filters">The filters.</param> public static void RegisterGlobalFilters(GlobalFilterCollection filters) { filters.Add(new RequireHttpsAttribute()); } } After this I also set 'Enable SSL' in the project's properties to

How to use nonces in asymmetric encryption (libsodium)?

微笑、不失礼 提交于 2019-12-01 04:16:38
I am writing an app where users can communicate between devices with end to end encryption. For this I use the libsodium encryption library. The asymmetric encryption function, crypto_box(...) requires a nonce as one of the arguments. I am a bit confused about how to handle nonces. Does every message to one person need to be encrypted using different nonces? This does not seem right since I would have to store the used nonces on a server with public access where an attacker could just use one of the used nonces again. Is it enough that all messages sent from A to B have different nonces or can

How to use nonces in asymmetric encryption (libsodium)?

…衆ロ難τιáo~ 提交于 2019-12-01 01:54:45
问题 I am writing an app where users can communicate between devices with end to end encryption. For this I use the libsodium encryption library. The asymmetric encryption function, crypto_box(...) requires a nonce as one of the arguments. I am a bit confused about how to handle nonces. Does every message to one person need to be encrypted using different nonces? This does not seem right since I would have to store the used nonces on a server with public access where an attacker could just use one