From speed1625 at gmail.com Wed Aug 1 06:56:42 2012
From: speed1625 at gmail.com (Giacomo D'Amico)
Date: Wed, 1 Aug 2012 12:56:42 +0200
Subject: [botan-devel] El Gamal key generation and import/export
Message-ID:
*Would someone post some sample code for El Gamal key generation and
import/export? Thanks a lot.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From timprepscius at gmail.com Wed Aug 8 19:53:49 2012
From: timprepscius at gmail.com (Timothy Prepscius)
Date: Wed, 8 Aug 2012 19:53:49 -0400
Subject: [botan-devel] question about power_mod
Message-ID: <10B51EB3-88AE-4359-8E0A-93640181CD95@gmail.com>
okay, so I 'm doing a port of jordan zimmerman's srp6a implementation.
(i know botan has a srp, but I believe it may not be compatible)
anyhow..
-------------------------
so in jordan's java implementation, he has a line:
fCommonValue_S = B_minus_g_pow_x.modPow(fRandom_a.add(ux), fConstants.largePrime_N).mod(fConstants.largePrime_N);
-------------------------
which translations to botan to:
fCommonValue_S =
Botan::power_mod(
B_minus_g_pow_x,
fRandom_a + ux,
fConstants.largePrime_N
) % fConstants.largePrime_N;
-------------------------
unfortunately the "fRandom_a + ux" is randomly negative.
for which botan does an exception throw.
I looked at the GNU class path for big integer, and I see this:
http://fuseyism.com/classpath/doc/java/math/BigInteger-source.html
public BigInteger modPow(BigInteger exponent, BigInteger m)
1177: {
1178: if (m.isNegative() || m.isZero())
1179: throw new ArithmeticException("non-positive modulo");
1180:
1181: if (exponent.isNegative())
1182: return modInverse(m).modPow(exponent.negate(), m);
------------------------------
does this "modInverse" taking a single argument have an equivalent in Botan?
Thanks!
-tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From timprepscius at gmail.com Wed Aug 8 19:56:49 2012
From: timprepscius at gmail.com (Timothy Prepscius)
Date: Wed, 8 Aug 2012 19:56:49 -0400
Subject: [botan-devel] question about power_mod
In-Reply-To: <10B51EB3-88AE-4359-8E0A-93640181CD95@gmail.com>
References: <10B51EB3-88AE-4359-8E0A-93640181CD95@gmail.com>
Message-ID: <647B7BA4-2CFF-4774-AEB1-38FD9A0A1D52@gmail.com>
never mind, I think I just got it, modInverse is single argument but using "this".
so inverse_mod
-tim
On Aug 8, 2012, at 7:53 PM, Timothy Prepscius wrote:
> okay, so I 'm doing a port of jordan zimmerman's srp6a implementation.
> (i know botan has a srp, but I believe it may not be compatible)
>
> anyhow..
>
> -------------------------
>
> so in jordan's java implementation, he has a line:
> fCommonValue_S = B_minus_g_pow_x.modPow(fRandom_a.add(ux), fConstants.largePrime_N).mod(fConstants.largePrime_N);
>
> -------------------------
>
> which translations to botan to:
>
> fCommonValue_S =
> Botan::power_mod(
> B_minus_g_pow_x,
> fRandom_a + ux,
> fConstants.largePrime_N
> ) % fConstants.largePrime_N;
>
> -------------------------
>
> unfortunately the "fRandom_a + ux" is randomly negative.
> for which botan does an exception throw.
>
>
> I looked at the GNU class path for big integer, and I see this:
>
> http://fuseyism.com/classpath/doc/java/math/BigInteger-source.html
>
> public BigInteger modPow(BigInteger exponent, BigInteger m)
> 1177: {
> 1178: if (m.isNegative() || m.isZero())
> 1179: throw new ArithmeticException("non-positive modulo");
> 1180:
> 1181: if (exponent.isNegative())
> 1182: return modInverse(m).modPow(exponent.negate(), m);
>
> ------------------------------
>
> does this "modInverse" taking a single argument have an equivalent in Botan?
>
> Thanks!
>
> -tim
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From timprepscius at gmail.com Wed Aug 8 20:18:11 2012
From: timprepscius at gmail.com (Timothy Prepscius)
Date: Wed, 8 Aug 2012 20:18:11 -0400
Subject: [botan-devel] question about power_mod
In-Reply-To: <647B7BA4-2CFF-4774-AEB1-38FD9A0A1D52@gmail.com>
References: <10B51EB3-88AE-4359-8E0A-93640181CD95@gmail.com>
<647B7BA4-2CFF-4774-AEB1-38FD9A0A1D52@gmail.com>
Message-ID:
You know I think I've done a bunch of unnecessary work. Lol.
I'm reading your srp code. It does look like it is the same.
Just wondering, do you do the java 2's complement with to 8 bit padding?
I see you are doing power_mod. Do you handle negative exponents?
-tim
On Aug 8, 2012, at 7:56 PM, Timothy Prepscius wrote:
> never mind, I think I just got it, modInverse is single argument but using "this".
>
> so inverse_mod
>
> -tim
>
> On Aug 8, 2012, at 7:53 PM, Timothy Prepscius wrote:
>
>> okay, so I 'm doing a port of jordan zimmerman's srp6a implementation.
>> (i know botan has a srp, but I believe it may not be compatible)
>>
>> anyhow..
>>
>> -------------------------
>>
>> so in jordan's java implementation, he has a line:
>> fCommonValue_S = B_minus_g_pow_x.modPow(fRandom_a.add(ux), fConstants.largePrime_N).mod(fConstants.largePrime_N);
>>
>> -------------------------
>>
>> which translations to botan to:
>>
>> fCommonValue_S =
>> Botan::power_mod(
>> B_minus_g_pow_x,
>> fRandom_a + ux,
>> fConstants.largePrime_N
>> ) % fConstants.largePrime_N;
>>
>> -------------------------
>>
>> unfortunately the "fRandom_a + ux" is randomly negative.
>> for which botan does an exception throw.
>>
>>
>> I looked at the GNU class path for big integer, and I see this:
>>
>> http://fuseyism.com/classpath/doc/java/math/BigInteger-source.html
>>
>> public BigInteger modPow(BigInteger exponent, BigInteger m)
>> 1177: {
>> 1178: if (m.isNegative() || m.isZero())
>> 1179: throw new ArithmeticException("non-positive modulo");
>> 1180:
>> 1181: if (exponent.isNegative())
>> 1182: return modInverse(m).modPow(exponent.negate(), m);
>>
>> ------------------------------
>>
>> does this "modInverse" taking a single argument have an equivalent in Botan?
>>
>> Thanks!
>>
>> -tim
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From timprepscius at gmail.com Wed Aug 8 20:30:03 2012
From: timprepscius at gmail.com (Timothy Prepscius)
Date: Wed, 8 Aug 2012 20:30:03 -0400
Subject: [botan-devel] question about power_mod
In-Reply-To:
References: <10B51EB3-88AE-4359-8E0A-93640181CD95@gmail.com>
<647B7BA4-2CFF-4774-AEB1-38FD9A0A1D52@gmail.com>
Message-ID:
Also, while I'm babbling.
At the end of zimmerman's srp6a there is a:
fSessionKey_K = SRPUtils.hashToBytesMD5(fCommonValue_S);
which produces 16 bytes, which then can be used for AES-128.
Do you know if there is a reason why he picked MD5 instead of doing another SHA256?
If I change this MD5 to SHA256 to generate 32 bytes for AES-256, am I going to be breaking some mathematical integrity?
Any thoughts?
(sort of random I know)
-tim
On Aug 8, 2012, at 8:18 PM, Timothy Prepscius wrote:
> You know I think I've done a bunch of unnecessary work. Lol.
> I'm reading your srp code. It does look like it is the same.
>
>
> Just wondering, do you do the java 2's complement with to 8 bit padding?
> I see you are doing power_mod. Do you handle negative exponents?
>
> -tim
>
>
> On Aug 8, 2012, at 7:56 PM, Timothy Prepscius wrote:
>
>> never mind, I think I just got it, modInverse is single argument but using "this".
>>
>> so inverse_mod
>>
>> -tim
>>
>> On Aug 8, 2012, at 7:53 PM, Timothy Prepscius wrote:
>>
>>> okay, so I 'm doing a port of jordan zimmerman's srp6a implementation.
>>> (i know botan has a srp, but I believe it may not be compatible)
>>>
>>> anyhow..
>>>
>>> -------------------------
>>>
>>> so in jordan's java implementation, he has a line:
>>> fCommonValue_S = B_minus_g_pow_x.modPow(fRandom_a.add(ux), fConstants.largePrime_N).mod(fConstants.largePrime_N);
>>>
>>> -------------------------
>>>
>>> which translations to botan to:
>>>
>>> fCommonValue_S =
>>> Botan::power_mod(
>>> B_minus_g_pow_x,
>>> fRandom_a + ux,
>>> fConstants.largePrime_N
>>> ) % fConstants.largePrime_N;
>>>
>>> -------------------------
>>>
>>> unfortunately the "fRandom_a + ux" is randomly negative.
>>> for which botan does an exception throw.
>>>
>>>
>>> I looked at the GNU class path for big integer, and I see this:
>>>
>>> http://fuseyism.com/classpath/doc/java/math/BigInteger-source.html
>>>
>>> public BigInteger modPow(BigInteger exponent, BigInteger m)
>>> 1177: {
>>> 1178: if (m.isNegative() || m.isZero())
>>> 1179: throw new ArithmeticException("non-positive modulo");
>>> 1180:
>>> 1181: if (exponent.isNegative())
>>> 1182: return modInverse(m).modPow(exponent.negate(), m);
>>>
>>> ------------------------------
>>>
>>> does this "modInverse" taking a single argument have an equivalent in Botan?
>>>
>>> Thanks!
>>>
>>> -tim
>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From timprepscius at gmail.com Sat Aug 11 10:39:50 2012
From: timprepscius at gmail.com (Timothy Prepscius)
Date: Sat, 11 Aug 2012 10:39:50 -0400
Subject: [botan-devel] question about power_mod
In-Reply-To:
References: <10B51EB3-88AE-4359-8E0A-93640181CD95@gmail.com>
<647B7BA4-2CFF-4774-AEB1-38FD9A0A1D52@gmail.com>
Message-ID: <9C280EF9-B3CD-4705-8005-060CC2EF4C52@gmail.com>
tl;dr: you might want to check your srp implementation for fRandom_a (aka A) is negative.
On Aug 8, 2012, at 8:30 PM, Timothy Prepscius wrote:
> Also, while I'm babbling.
>
> At the end of zimmerman's srp6a there is a:
>
> fSessionKey_K = SRPUtils.hashToBytesMD5(fCommonValue_S);
> which produces 16 bytes, which then can be used for AES-128.
>
> Do you know if there is a reason why he picked MD5 instead of doing another SHA256?
> If I change this MD5 to SHA256 to generate 32 bytes for AES-256, am I going to be breaking some mathematical integrity?
>
>
> Any thoughts?
> (sort of random I know)
>
> -tim
>
> On Aug 8, 2012, at 8:18 PM, Timothy Prepscius wrote:
>
>> You know I think I've done a bunch of unnecessary work. Lol.
>> I'm reading your srp code. It does look like it is the same.
>>
>>
>> Just wondering, do you do the java 2's complement with to 8 bit padding?
>> I see you are doing power_mod. Do you handle negative exponents?
>>
>> -tim
>>
>>
>> On Aug 8, 2012, at 7:56 PM, Timothy Prepscius wrote:
>>
>>> never mind, I think I just got it, modInverse is single argument but using "this".
>>>
>>> so inverse_mod
>>>
>>> -tim
>>>
>>> On Aug 8, 2012, at 7:53 PM, Timothy Prepscius wrote:
>>>
>>>> okay, so I 'm doing a port of jordan zimmerman's srp6a implementation.
>>>> (i know botan has a srp, but I believe it may not be compatible)
>>>>
>>>> anyhow..
>>>>
>>>> -------------------------
>>>>
>>>> so in jordan's java implementation, he has a line:
>>>> fCommonValue_S = B_minus_g_pow_x.modPow(fRandom_a.add(ux), fConstants.largePrime_N).mod(fConstants.largePrime_N);
>>>>
>>>> -------------------------
>>>>
>>>> which translations to botan to:
>>>>
>>>> fCommonValue_S =
>>>> Botan::power_mod(
>>>> B_minus_g_pow_x,
>>>> fRandom_a + ux,
>>>> fConstants.largePrime_N
>>>> ) % fConstants.largePrime_N;
>>>>
>>>> -------------------------
>>>>
>>>> unfortunately the "fRandom_a + ux" is randomly negative.
>>>> for which botan does an exception throw.
>>>>
>>>>
>>>> I looked at the GNU class path for big integer, and I see this:
>>>>
>>>> http://fuseyism.com/classpath/doc/java/math/BigInteger-source.html
>>>>
>>>> public BigInteger modPow(BigInteger exponent, BigInteger m)
>>>> 1177: {
>>>> 1178: if (m.isNegative() || m.isZero())
>>>> 1179: throw new ArithmeticException("non-positive modulo");
>>>> 1180:
>>>> 1181: if (exponent.isNegative())
>>>> 1182: return modInverse(m).modPow(exponent.negate(), m);
>>>>
>>>> ------------------------------
>>>>
>>>> does this "modInverse" taking a single argument have an equivalent in Botan?
>>>>
>>>> Thanks!
>>>>
>>>> -tim
>>>>
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From lloyd at randombit.net Sat Aug 11 13:13:18 2012
From: lloyd at randombit.net (Jack Lloyd)
Date: Sat, 11 Aug 2012 13:13:18 -0400
Subject: [botan-devel] question about power_mod
In-Reply-To: <9C280EF9-B3CD-4705-8005-060CC2EF4C52@gmail.com>
References: <10B51EB3-88AE-4359-8E0A-93640181CD95@gmail.com>
<647B7BA4-2CFF-4774-AEB1-38FD9A0A1D52@gmail.com>
<9C280EF9-B3CD-4705-8005-060CC2EF4C52@gmail.com>
Message-ID: <20120811171318.GJ30398@randombit.net>
On Sat, Aug 11, 2012 at 10:39:50AM -0400, Timothy Prepscius wrote:
> tl;dr: you might want to check your srp implementation for fRandom_a (aka A) is negative.
Hmm, yeah I assumed if(A % p == 0) would be fine, and it is for
TLS-SRP, but I suppose if it was being used with a serialization
method that allowed negative numbers like ASN.1 there could be
problems. And two compares is going to be cheaper than a reduction
anyway. Thanks for pointing that out.
-Jack
From info at stephan-jauernick.de Fri Aug 17 17:03:37 2012
From: info at stephan-jauernick.de (Stephan Jauernick)
Date: Fri, 17 Aug 2012 23:03:37 +0200
Subject: [botan-devel] Botan and Qt
Message-ID: <502EB1A9.2000705@stephan-jauernick.de>
Hi,
is there a way to compile the botan libs with qt(MSVC and MINGW)?
Sincerely,
Stephan
From christian.kandeler at nokia.com Mon Aug 20 04:52:09 2012
From: christian.kandeler at nokia.com (Christian Kandeler)
Date: Mon, 20 Aug 2012 10:52:09 +0200
Subject: [botan-devel] Botan and Qt
In-Reply-To: <502EB1A9.2000705@stephan-jauernick.de>
References: <502EB1A9.2000705@stephan-jauernick.de>
Message-ID: <5031FAB9.7050705@nokia.com>
On 17/08/12 23:03, ext Stephan Jauernick wrote:
> is there a way to compile the botan libs with qt(MSVC and MINGW)?
What do you mean by that? Qt is one library, Botan is another. What
exactly do you plan to do?
Christian