Click here to Skip to main content
15,893,564 members
Home / Discussions / C#
   

C#

 
AnswerRe: Update contents of Folder before Installation of MSI file Pin
N a v a n e e t h15-Sep-09 20:14
N a v a n e e t h15-Sep-09 20:14 
GeneralRe: Update contents of Folder before Installation of MSI file Pin
Abdul Rahman Hamidy15-Sep-09 21:53
Abdul Rahman Hamidy15-Sep-09 21:53 
AnswerRe: Update contents of Folder before Installation of MSI file Pin
Vimalsoft(Pty) Ltd15-Sep-09 21:01
professionalVimalsoft(Pty) Ltd15-Sep-09 21:01 
GeneralRe: Update contents of Folder before Installation of MSI file Pin
Abdul Rahman Hamidy16-Sep-09 3:17
Abdul Rahman Hamidy16-Sep-09 3:17 
GeneralRe: Update contents of Folder before Installation of MSI file Pin
Vimalsoft(Pty) Ltd16-Sep-09 3:18
professionalVimalsoft(Pty) Ltd16-Sep-09 3:18 
QuestionHow to make a simple stream cipher encryption for C# Pin
wSheng8715-Sep-09 19:50
wSheng8715-Sep-09 19:50 
AnswerRe: How to make a simple stream cipher encryption for C# Pin
Christian Graus15-Sep-09 20:10
protectorChristian Graus15-Sep-09 20:10 
AnswerRe: How to make a simple stream cipher encryption for C# Pin
PIEBALDconsult16-Sep-09 7:12
mvePIEBALDconsult16-Sep-09 7:12 
It really depends on how much security you need.
If you need a lot of security then you're not likely to be able to retain the 10-digit requirement.
If only a little security is need then maybe you don't need any at all. Big Grin | :-D

Can you give more information?

Anyway... this may be an area where just a little security can go a long way; after all, how would someone who intercepts the message know he had correctly deciphered the number?

The following code is an example of a very simple/non-secure encription algorithm, similar to ROT13[^]:

private static readonly System.Collections.Generic.Dictionary<char,char> wombat ;
 
static Template
(
)
{
    wombat = new System.Collections.Generic.Dictionary<char,char>() ;
 
    wombat [ '0' ] = '9' ;
    wombat [ '1' ] = '8' ;
    wombat [ '2' ] = '7' ;
    wombat [ '3' ] = '6' ;
    wombat [ '4' ] = '5' ;
    wombat [ '5' ] = '4' ;
    wombat [ '6' ] = '3' ;
    wombat [ '7' ] = '2' ;
    wombat [ '8' ] = '1' ;
    wombat [ '9' ] = '0' ;
 
    return ;
}
 
private static string
Wombat
(
    string s
)
{
    System.Text.StringBuilder result = new System.Text.StringBuilder() ;
 
    foreach ( char c in s )
    {
        if ( wombat.ContainsKey ( c ) )
        {
            result.Append ( wombat [ c ] ) ;
        }
        else
        {
            result.Append ( c ) ;
        }
    }
 
    return ( result.ToString() ) ;
}


If more security is required, you could extend this to provide for passing a "key" between partners, but you would then need separate encription and decription methods.
GeneralRe: How to make a simple stream cipher encryption for C# Pin
wSheng8716-Sep-09 16:35
wSheng8716-Sep-09 16:35 
GeneralRe: How to make a simple stream cipher encryption for C# Pin
PIEBALDconsult16-Sep-09 18:40
mvePIEBALDconsult16-Sep-09 18:40 
QuestionHow to copy execuitable Pin
DarkSorrow3815-Sep-09 18:54
DarkSorrow3815-Sep-09 18:54 
AnswerRe: How to copy execuitable Pin
egenis15-Sep-09 19:19
egenis15-Sep-09 19:19 
Questioncode doubt Pin
anishkannan15-Sep-09 18:22
anishkannan15-Sep-09 18:22 
AnswerRe: code doubt Pin
Luc Pattyn15-Sep-09 18:25
sitebuilderLuc Pattyn15-Sep-09 18:25 
GeneralRe: code doubt Pin
dybs15-Sep-09 18:27
dybs15-Sep-09 18:27 
AnswerRe: code doubt Pin
dybs15-Sep-09 18:27
dybs15-Sep-09 18:27 
AnswerRe: code doubt Pin
CPallini15-Sep-09 21:34
mveCPallini15-Sep-09 21:34 
AnswerRe: code doubt Pin
rakesh_choudhury15-Sep-09 22:12
rakesh_choudhury15-Sep-09 22:12 
QuestionASP.NET Membership and WinForms Pin
Illegal Operation15-Sep-09 15:43
Illegal Operation15-Sep-09 15:43 
AnswerRe: ASP.NET Membership and WinForms Pin
N a v a n e e t h15-Sep-09 18:15
N a v a n e e t h15-Sep-09 18:15 
QuestionDatabase question with c#. Pin
JollyMansArt15-Sep-09 13:38
JollyMansArt15-Sep-09 13:38 
AnswerRe: Database question with c#. Pin
Not Active15-Sep-09 14:54
mentorNot Active15-Sep-09 14:54 
QuestionC# coding problem Pin
Jemami15-Sep-09 13:26
Jemami15-Sep-09 13:26 
QuestionRe: C# coding problem Pin
harold aptroot15-Sep-09 13:34
harold aptroot15-Sep-09 13:34 
AnswerRe: C# coding problem Pin
Jemami15-Sep-09 13:37
Jemami15-Sep-09 13:37 

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

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