473,320 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Encription is too long - Advice please

Hi,

I am using MD5, SHA1, SHA256, SHA384, SHA512 and results are:

I am using Encryption data with salt example
(http://www.obviex.com/samples/EncryptionWithSalt.aspx)

Everything works and results are:
MD5 : G+bfg1UoPgaSVABFpLFZzxQ+h6WZkw==
SHA1 : gi4jz/elgpXY9fvxAo/HOMw9XPc80aZYEg==
SHA256: jm1YCvn5CuluseY2PtQLbZDfPgLXtRjTypj1EPf/pHta2n7B7r0=
SHA384:
FzSCLzDw1b+JZNX4D+hoNJIcbMhHY/Plf7wooBKu9NHFXQzGC5TAbY1wrjyFeiqJPNaxaNctIg==
SHA512:
h+KRwibmpSrljPRWUX8IAW0Yy1udohEYK+nsJYU3u0icgSiGxw tiO5IZt9i+oRXm4e1qgCjz3jT9yo1rcLG1ie9ptIs=

These results are too long for my purposes. I would like to generate key for
application. It must be readable for user, desirable objective is something
like this: AS344-SADAD-ASA44-ALKLH-GHNNG

Anyway, I can use shapes like above (G+bfg1UoPgaSVABFpLFZzxQ+h6WZkw==) and I
can put dashes (-) between but It should be more shorter and capital. User
should got this number on paper and need to write that into application on
first start (setup)

What kind of encryption I should use and how?

Please, give me advise and tell me how to do that. If is possible point me
on some real code example?

Thanks to all.

:)
Nov 17 '05 #1
5 1722
try minimum block size (i think its 8byte for rijndael algorithm.) and
"implement your own base64 string convertion"
Nov 17 '05 #2
> These results are too long for my purposes. I would like to generate key for
application. It must be readable for user, desirable objective is something
like this: AS344-SADAD-ASA44-ALKLH-GHNNG


How about using GUIDs?

Regards,
Sarin.

Nov 17 '05 #3
Washington wrote:
I am using MD5, SHA1, SHA256, SHA384, SHA512 and results are:


<snip>

How much data are you trying to encrypt? MD5 and SHA aren't really
encryption - they're hashes. You won't be able to get back the original
data from the hash. What are you actually trying to achieve here?
What's the bigger picture? If you're just trying to generate a random
key, I'd go with GUIDs as suggested by another poster.

Jon

Nov 17 '05 #4
It is true. SHA isn't encryption and it is not good for this what I want.

I am trying to make a key for product on the "salt" way. For example if
encrypting Hello World string we will get:

Encrypted #0: RZgqk+ZCpDtkz1seyKP/AhL+vheicchZEBWfG5gOHyg=
Encrypted #1: NetGFd9SBC+9vJQ1MGLih3szfcJ3GwugdjKhEsIdrCs=
Encrypted #2: CSAFtGmfus77c2tMmsu9JohymMLPNyZtntHeTm0zsPQ=
Encrypted #3: +iB/LfwCalGuIUvvClikpBmyL8l4NaoZ3lS45nBjZTI=
Encrypted #4: 6+z3cKo4t9vHNaMZboUdfW8T3nRpxGFQ6pKJ/67sSYA=
Encrypted #5: sv90H5pRYpCPUJfcRfcXGEJUETIJRonjjc+GxWnzFHI=
Encrypted #6: A0WR0tifcS5Pqd36aA42E401O9tni52rdDuHeJ15yrM=
Encrypted #7: 3tKjoxGRvM/m/4MBV1XXiE6yXBeCE071oTsRjAKixRM=
Encrypted #8: 5u5pWZWT8HjKDtfpUfNfzwkU0+BnKokjyiil5HPlqKA=
Encrypted #9: 0qMlj+391fSn+Vv0TjtwJ7QLbSGMYBHuHUTqYej397k=
Encrypted #10: KdCWxE9CxZ1LyokdH5+uu5kNSYW0cXiLqPhwoxucFXU=

It is the same thing (Hello World) on ten different ways and it is exactly
what I want and it works. In this example Rijndel encryption is aplied, with
added salt value (randomly generated bytes) to plain text before the value
is encrypted.

Problem:
This key is too long and it is where problem is, user need something
readable, for e.g. DSDSD-SAA78-SA98A-OPOKK-798JL
It is to hard to write something like this
sv90H5pRYpCPUJfcRfcXGEJUETIJRonjjc+GxWnzFHI= sign by sign :( and I can not
expect that from users.

May be, just may be somewhere solution exists and may be is not necessary to
make a lot of code for that. For e.g. I can capital all leters but how I can
now to make coversation later...

Thanks :)

For
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Washington wrote:
I am using MD5, SHA1, SHA256, SHA384, SHA512 and results are:


<snip>

How much data are you trying to encrypt? MD5 and SHA aren't really
encryption - they're hashes. You won't be able to get back the original
data from the hash. What are you actually trying to achieve here?
What's the bigger picture? If you're just trying to generate a random
key, I'd go with GUIDs as suggested by another poster.

Jon

Nov 17 '05 #5
Washington <ab******@yahoo.com> wrote:
Problem:
This key is too long and it is where problem is, user need something
readable, for e.g. DSDSD-SAA78-SA98A-OPOKK-798JL
It is to hard to write something like this
sv90H5pRYpCPUJfcRfcXGEJUETIJRonjjc+GxWnzFHI= sign by sign :( and I can not
expect that from users.


If you only want the users to enter a small amount of encrypted text
(and using a relatively small set of characters) then you can't expect
to be able to decrypt it to a large amount of original text.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: cody | last post by:
We have a huge project, the solutuion spans 50 projects growing. Everytime I want to start the project I have to wait nearly over 1 minute for the compiler to complete building. This is...
2
by: Bryan Olson | last post by:
The current Python standard library provides two cryptographic hash functions: MD5 and SHA-1 . The authors of MD5 originally stated: It is conjectured that it is computationally infeasible to...
9
by: Joriveek | last post by:
Hi, I want to store myvarz = 3000000000; I have declared myvarz as unsigned long; still not taking. I am using MSVC++ 6.0 Any help please urgent....
0
by: Hanif Ismail | last post by:
How can i encript and decript a file using csharp? Please help me.
8
by: Bryan Parkoff | last post by:
int has two bytes or four bytes. long has four bytes or eight bytes. I can't be sure to choose int or long keyword because I don't trust to get the wrong size. I always check by using...
7
by: pedagani | last post by:
Dear comp.lang.c++, I'm trying to read a file with very long filename using ifstream. Although, the file exists the file open for read fails. Is there a restriction on the size? I'm using winXP...
1
by: nitinloml | last post by:
i want to know the different methods for pwd encription
3
by: Ritu1 | last post by:
Hi, I have an Oracle table with a column of long raw datatype. I want to see the data in this column so I can manipulate it. Can you please advice on some function/procedure to convert this to...
2
by: spike909 | last post by:
how encription and decription take place in c#? what methods and functions are used to develop a project in c# corresponding to encription and decription?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.