Click here to Skip to main content
11,434,611 members (61,799 online)

Algorithms

 
QuestionLinear algebra jacobi Singular Value Decomposition (SVD) algorithm Pin
BupeChombaDerrick12-Feb-13 21:25
memberBupeChombaDerrick12-Feb-13 21:25 
AnswerRe: Linear algebra jacobi Singular Value Decomposition (SVD) algorithm Pin
BupeChombaDerrick13-Feb-13 20:32
memberBupeChombaDerrick13-Feb-13 20:32 
QuestionAlgorithm for creating new parser Pin
somanath kavalase1-Feb-13 22:18
membersomanath kavalase1-Feb-13 22:18 
AnswerRe: Algorithm for creating new parser Pin
Eddy Vluggen2-Feb-13 1:52
mvpEddy Vluggen2-Feb-13 1:52 
AnswerRe: Algorithm for creating new parser Pin
jschell2-Feb-13 8:55
memberjschell2-Feb-13 8:55 
AnswerRe: Algorithm for creating new parser Pin
sep11-Feb-13 5:18
membersep11-Feb-13 5:18 
Questionlanguage translation Pin
serena simmy30-Jan-13 19:12
memberserena simmy30-Jan-13 19:12 
AnswerRe: language translation Pin
Alan Balkany1-Feb-13 6:04
memberAlan Balkany1-Feb-13 6:04 
GeneralRe: language translation Pin
serena simmy2-Feb-13 3:35
memberserena simmy2-Feb-13 3:35 
QuestionAES algorithm Pin
lamar nadeen16-Jan-13 5:36
memberlamar nadeen16-Jan-13 5:36 
AnswerRe: AES algorithm Pin
Alan N16-Jan-13 6:10
memberAlan N16-Jan-13 6:10 
AnswerRe: AES algorithm Pin
pasztorpisti23-Jan-13 21:34
memberpasztorpisti23-Jan-13 21:34 
AnswerRe: AES algorithm Pin
Edo Tzumer11-Feb-13 20:46
memberEdo Tzumer11-Feb-13 20:46 
QuestionImplementation of Secure Remote Password in VB.NET Pin
DisIsHoody12-Jan-13 15:22
memberDisIsHoody12-Jan-13 15:22 
I'm trying to code the Secure Remote Password protocol (RFC 2945). I wasn't sure if I was getting the correct values at each stage so I did some searching and came across RFC 5054 which supplies some test vectors. I believe my problem is coming from the conversions between hex string, integers, bytes, and BigIntegers, however I just can't seem to track it down. Below is just one parameter that I need to calculate, but since all the other parameters are calculated in a similar way, if I can get this one working, all the rest should be fine.

Parameters
N - Large 1,024 bit safe prime number. The hex value is:
EEAF0AB9 ADB38DD6 9C33F80A FA8FC5E8 60726187 75FF3C0B 9EA2314C
9C256576 D674DF74 96EA81D3 383B4813 D692C6E0 E0D5D8E2 50B98BE4
8E495C1D 6089DAD1 5DC7D7B4 6154D6B6 CE8EF4AD 69B15D49 82559B29
7BCF1885 C529F566 660E57EC 68EDBC3C 05726CC0 2FD4CBF4 976EAA9A
FD5138FE 8376435B 9FC61D2F C0EB06E3
g - A generator of N with a value of 2

a - Private random number. Test vector provides the following to use:
60975527 035CF2AD 1989806F 0407210B C81EDC04 E2762A56 AFD529DD 
DA2D4393
A - Public value I'm trying to computer. A = g^a % N

Obviously these are large numbers to be working with, so I'm using the BigInteger class from the System.Numeric namespace in VB.NET 4. I'm tried many different ways to get this to work. Below is my latest incarnation of the code trying to compute A:
Dim strN As String = "EEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C" & _
                     "9C256576D674DF7496EA81D3383B4813D692C6E0E0D5D8E250B98BE4" & _
                     "8E495C1D6089DAD15DC7D7B46154D6B6CE8EF4AD69B15D4982559B29" & _
                     "7BCF1885C529F566660E57EC68EDBC3C05726CC02FD4CBF4976EAA9A" & _
                     "FD5138FE8376435B9FC61D2FC0EB06E3"
 
Dim N As BigInteger = BigInteger.Parse(strN, Globalization.NumberStyles.HexNumber)
Dim g As New BigInteger(2)
Dim private_a_hex As String = "60975527035CF2AD1989806F0407210BC81EDC04E2762A56AFD529DDDA2D4393"
Dim private_a As BigInteger = BigInteger.Parse(private_a_hex, Globalization.NumberStyles.HexNumber)
Dim public_A As BigInteger = BigInteger.ModPow(g, private_a, N)
Dim public_A_hex As String = public_A.ToString("X")
When I run the above code public_A_hex (which is hold the value of A), I'm getting the following hex string:
0CB3B3D1 59B9DFD8 7D5995E2 BAF4D4DC E8A27402 B388652E 133E4A67 
2D63FAE8 D432E166 2C2A23A3 8E67D164 49282934 20AC0693 7F3182F5 
3EB21DA2 5CE20CCB 27075CCB 21664335 9CFB2816 7B378F9A F0F9534F 
6A2BB9E8 9A5FEAD2 38DFDF7C ABDB747B FEB127CB 9E4A08DF 08D813F5 
D874B65B 9D43AAAD 102700BC 160365F7
However RFC 5054 says that A should be the follow:
61D5E490 F6F1B795 47B0704C 436F523D D0E560F0 C64115BB 72557EC4
4352E890 3211C046 92272D8B 2D1A5358 A2CF1B6E 0BFCF99F 921530EC
8E393561 79EAE45E 42BA92AE ACED8251 71E1E8B9 AF6D9C03 E1327F44
BE087EF0 6530E69F 66615261 EEF54073 CA11CF58 58F0EDFD FE15EFEA
B349EF5D 76988A36 72FAC47B 0769447B
I'm thinking the error is coming from the endianness of the byte arrays/hex strings; I've tried reversing arrays before and after each conversion with still no luck. I don't know where to go from here at this point as I've been working on this for a little over 2 days.

I know that there are some libraries out there, but at this point I don't want to use them. Since the values don't work out, and I can't figure out why, I would like to know what I'm doing wrong and improve my knowledge in the process.

Any help or guidance would be greatly appreciated.

Thanks,

Dominick
GeneralRe: Implementation of Secure Remote Password in VB.NET Pin
harold aptroot12-Jan-13 23:17
memberharold aptroot12-Jan-13 23:17 
GeneralRe: Implementation of Secure Remote Password in VB.NET Pin
DisIsHoody13-Jan-13 3:17
memberDisIsHoody13-Jan-13 3:17 
GeneralRe: Implementation of Secure Remote Password in VB.NET Pin
harold aptroot13-Jan-13 6:03
memberharold aptroot13-Jan-13 6:03 
QuestionRobot voice and FFT Pin
ltronghau28-Dec-12 22:30
memberltronghau28-Dec-12 22:30 
AnswerRe: Robot voice and FFT Pin
Albert Holguin11-Feb-13 15:59
memberAlbert Holguin11-Feb-13 15:59 
GeneralRe: Robot voice and FFT Pin
Andy Allinger21-Jan-14 16:44
professionalAndy Allinger21-Jan-14 16:44 
GeneralRe: Robot voice and FFT Pin
Albert Holguin22-Jan-14 4:14
professionalAlbert Holguin22-Jan-14 4:14 
QuestionHow to get the index of a cell in a Table Pin
pix_programmer20-Dec-12 2:27
memberpix_programmer20-Dec-12 2:27 
AnswerRe: How to get the index of a cell in a Table Pin
Richard MacCutchan20-Dec-12 3:10
mvpRichard MacCutchan20-Dec-12 3:10 
Questionconfusions Pin
en41117-Dec-12 23:37
memberen41117-Dec-12 23:37 
AnswerRe: confusions Pin
Alan Balkany18-Dec-12 6:43
memberAlan Balkany18-Dec-12 6:43 
QuestionWhen completing a bespoke programme should I give the code up? Pin
itorchuk17-Dec-12 9:08
memberitorchuk17-Dec-12 9:08 
AnswerRe: When completing a bespoke programme should I give the code up? Pin
jschell17-Dec-12 9:27
memberjschell17-Dec-12 9:27 
GeneralRe: When completing a bespoke programme should I give the code up? Pin
itorchuk17-Dec-12 9:37
memberitorchuk17-Dec-12 9:37 
GeneralRe: When completing a bespoke programme should I give the code up? Pin
StyleTech Solutions Ltd10-Feb-13 10:50
groupStyleTech Solutions Ltd10-Feb-13 10:50 
QuestionPrime Number Generation Pin
Joshua Guyette14-Dec-12 10:36
memberJoshua Guyette14-Dec-12 10:36 
AnswerRe: Prime Number Generation Pin
Alan Balkany17-Dec-12 5:39
memberAlan Balkany17-Dec-12 5:39 
AnswerRe: Prime Number Generation [modified] Pin
April Fans19-Dec-12 20:34
memberApril Fans19-Dec-12 20:34 
AnswerRe: Prime Number Generation Pin
_Kel_30-Dec-12 5:44
member_Kel_30-Dec-12 5:44 
QuestionFinding Bounding Entities Pin
Kyudos9-Dec-12 13:10
memberKyudos9-Dec-12 13:10 
AnswerRe: Finding Bounding Entities Pin
Alan Balkany10-Dec-12 6:28
memberAlan Balkany10-Dec-12 6:28 
Questionneed a guidance Pin
en4114-Dec-12 23:08
memberen4114-Dec-12 23:08 
AnswerRe: need a guidance Pin
Alan Balkany5-Dec-12 5:55
memberAlan Balkany5-Dec-12 5:55 
AnswerRe: need a guidance Pin
Dr. Hurol Aslan1-Feb-13 4:55
memberDr. Hurol Aslan1-Feb-13 4:55 
GeneralUSING PARTICLE SWARM OPTIMIZATION IN MATLAB Pin
IBRAHIM HASSAN MTOLERA3-Dec-12 7:34
memberIBRAHIM HASSAN MTOLERA3-Dec-12 7:34 
Questionalgorithms??? Pin
en4111-Dec-12 16:13
memberen4111-Dec-12 16:13 
AnswerRe: algorithms??? Pin
Peter_in_27801-Dec-12 20:34
memberPeter_in_27801-Dec-12 20:34 
QuestionRe: algorithms??? [modified] Pin
April Fans27-Dec-12 5:17
memberApril Fans27-Dec-12 5:17 
NewsWilling to Trade Ad Space on My site for work on my site Pin
Beyslist114-Nov-12 18:15
memberBeyslist114-Nov-12 18:15 
QuestionNeed a Classified Ad Aggregator Algorithm Pin
Beyslist114-Nov-12 18:14
memberBeyslist114-Nov-12 18:14 
Questionfinding the best algorithm Pin
speedchandu20-Oct-12 12:32
memberspeedchandu20-Oct-12 12:32 
AnswerRe: finding the best algorithm Pin
Alan Balkany22-Oct-12 6:00
memberAlan Balkany22-Oct-12 6:00 
GeneralRe: finding the best algorithm Pin
speedchandu22-Oct-12 21:12
memberspeedchandu22-Oct-12 21:12 
GeneralRe: finding the best algorithm [modified] Pin
_Kel_23-Oct-12 0:36
member_Kel_23-Oct-12 0:36 
GeneralRe: finding the best algorithm Pin
AshrafKawarezmey14-Nov-12 5:57
memberAshrafKawarezmey14-Nov-12 5:57 
AnswerRe: finding the best algorithm Pin
YvesDaoust22-Oct-12 22:41
memberYvesDaoust22-Oct-12 22:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.150428.2 | Last Updated 5 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid