Home > Archive > Clipper > December 2005 > Clipper tools library
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Clipper tools library
|
|
|
| Hi at all,
I am unable to use best the function crypt() of clipper tools.
Please can you make an example about?
1)To encrypt data and store it into a field of a dnf.file
2)to decrypt data ftom a dbf file
Thank in advance
| |
|
|
|
|
"E. Fridman"
wrote:
>
> Try something along these lines:
>
> Field->incrypted := CRYPT(cString, cPassword)
>
> cDecrypted := CRYPT(Field->incrypted, cPassword)
>
> ? cString. cDecrypted
>
> HTH, Eugene
>
Ok but I am sorry I must do an other thing also:
I want encrypt a frase with the password equal to my frase like
cEncr:=crypt("Hallo jef","Hallo jef")
still here work
cDecr:=crypt(cEncr,cEncr)
here do not work because ir do not decrypt but encrypt an other time
Is it possible?
Steel
| |
| Przemyslaw Czerpak 2005-12-13, 7:55 am |
| On Tue, 13 Dec 2005 09:11:29 GMT,
Steel <steel@nonspam.com> wrote:
> Ok but I am sorry I must do an other thing also:
> I want encrypt a frase with the password equal to my frase like
> cEncr:=crypt("Hallo jef","Hallo jef")
> still here work
> cDecr:=crypt(cEncr,cEncr)
> here do not work because ir do not decrypt but encrypt an other time
> Is it possible?
By definition if the above would be possible then the encrypted
string could be decrypted by anyone who knows used algorithm so
it does not have any sense.
best regards,
Przemek
| |
| Dave P 2005-12-13, 6:55 pm |
| do somthing like the below...change the algorithm too your own or
whatever.....this is good for passwords and stuff like that...but not a
complet file too slow
/ ***********************
FUNCTION ENCRYPT(cVar)
// *************************
local x,cNewVar:="",nLength:=len(cVar)
FOR x:=1 to nLength
cNewVar:=(cNewVar+CHR((ASC(SUBSTR(cVar,X
,1))+((X*33)-4))))
NEXT
RETURN(cNewVar)
// ************************
FUNCTION DECRYPT(cVar)
// *************************
LOCAL X,cNewVar:="",nLength:=Len(cVar)
FOR X:=1 TO nLength
cNewVar:=(cNewVar+CHR((ASC(SUBSTR(cVar,X
,1))-((X*33)-4))))
NEXT
RETURN(cNewVar)
"Steel" <steel@nonspam.com> wrote in message
news:YQbnf.32556$S6.611626@twister2.libero.it...
> Hi at all,
> I am unable to use best the function crypt() of clipper tools.
> Please can you make an example about?
> 1)To encrypt data and store it into a field of a dnf.file
> 2)to decrypt data ftom a dbf file
>
> Thank in advance
>
>
| |
|
|
"Przemyslaw Czerpak"
wrote:
> it does not have any sense.
>
> best regards,
> Przemek
The sense is that I want to encrypt the password or hide it bevause it is
easy to found with a source code editor
Do you undertand???
Steel
| |
| Dave P 2005-12-13, 6:55 pm |
| i posted some code too encrypt a string up too 64k no key required...
Now...the un-encrypted string should nver be un-encryped or stored
anywhere...
so based on your application you can do what you want with it..hide it in a
dnf,inf, hidden file somewhere on the disk...
can you be more specific about what exactly that you are looking for
dave
"Steel" <steel@nonspam.com> wrote in message
news:YQbnf.32556$S6.611626@twister2.libero.it...
> Hi at all,
> I am unable to use best the function crypt() of clipper tools.
> Please can you make an example about?
> 1)To encrypt data and store it into a field of a dnf.file
> 2)to decrypt data ftom a dbf file
>
> Thank in advance
>
>
| |
| ReIncarnated 2005-12-13, 6:55 pm |
| I have a program (written many moons ago) that can insert an encrypted
data string into a compiled EXE for you.
This system is also used to keep track of clients versions and
permanently brand the EXE.
If you are interested in it, email me at
i underscore think underscore your at hotmail dot com
(replace the obvious in the above email address)
It isn't used for a password, but is used for ensuring only the
registered owner of the software can use it.
On Tue, 13 Dec 2005 17:09:49 GMT, "Steel" <steel@nonspam.com> wrote:
>
>"Przemyslaw Czerpak"
>wrote:
>The sense is that I want to encrypt the password or hide it bevause it is
>easy to found with a source code editor
>
>Do you undertand???
>
>Steel
>
John.
| |
| Stephen Quinn 2005-12-13, 6:55 pm |
|
> I want encrypt a frase with the password equal to my frase like
> cEncr:=crypt("Hallo jef","Hallo jef")
> still here work
> cDecr:=crypt(cEncr,cEncr)
That makes no sense whatsoever.
It means you'd have to store the plain text (phrase) of everything you encrypted
somewhere.
Eg
cPhrase := "Hallo jef"
cPWd := "Hallo jef"
cEncr:=crypt( cPhrase, cPWD )
FIELD->EncData := cEncr
FIELD->UnEncData := cPhrase
No need to decrypt as you already have the decrypted string/phrase stored
somewhere
- if you don't store it then you'll never be able to decrypt your data.
HTH
Steve
| |
| Stephen Quinn 2005-12-13, 6:55 pm |
| > The sense is that I want to encrypt the password or hide it bevause it is
> easy to found with a source code editor
Use Blinker and compression
- try to find the encryption key in the compressed .exe
HTH
Steve
| |
|
| "Dave P"
wrote:
....> i posted some code too encrypt a string up too 64k no key required...
HI, Dave I looked this mornung your code and I am testing it.
I thank you very much.
I tryed to encryot and decript password and they work very well but I
thought that can made some problems using this functions to encrypt the
data conteined into all fields of a dbf.
Infact I am trying to encrypt a dbf (names.dbf) that hace an index name.cdx
Before to save a new name and address,zip city etc... I encrypt them.
At last I am all dbf file encrypted.
How work index?
How can I do to found a name using s or locate?
How can I do do browse the dbf with tbrosedb?
Regards
Steel
| |
| Przemyslaw Czerpak 2005-12-14, 3:55 am |
| On Tue, 13 Dec 2005 17:09:49 GMT,
Steel <steel@nonspam.com> wrote:
> The sense is that I want to encrypt the password or hide it bevause it is
> easy to found with a source code editor
> Do you undertand???
I think I understand that you want to encrypt some data.
And just simply I noticed you that using any method which
can decrypt such encrypted data with single function like:
deCrypt( <cData>, <cData> ) -> <cDeCryptData>
is nonsens because be definition if such function exists
then also function like myDeCrypt( <cData> ) -> <cDeCryptData>
will have to exist because it can be implemented as:
function myDeCrypt( cData )
return deCrypt( cData, cData )
It means that in cData and body of deCrypt() you have to encode
all information necessary to decode data. Farther because cData
is given variable attribute of deCrypt() function then all
information necessary to break such encoding is inside the algorithm
of deCrypt() function so the final result will not give you any
valuable encoding which cannot be easy broken by any clever enough
teen years guys - he will only have to spend a little bit of time
with debugger or use google with your name and 'crypt' keyword to
find someone who suggested you encoding algorithm which you used.
And this finally gives yet another conclusion: as long as you do not
begin to think what you are asking for then it will be much safer
for you if you simply hard code in your source code a fixed string
used to encrypt/decrypt the key used for farther encryption/decryption
and don't inform anyone about it. Build this fixed string using some
set of functions so it cannot be easy find in binaries. It will
eliminate at lest the google as one of breaking method ;-) but of
course does not stop someone who has some time and knowledge.
best regards,
Przemek
| |
| AUGE_OHR 2005-12-14, 6:55 pm |
| hi,
> Infact I am trying to encrypt a dbf (names.dbf) that hace an index
name.cdx
> Before to save a new name and address,zip city etc... I encrypt them.
> At last I am all dbf file encrypted.
> How work index?
that the point of a "crypt" DBF. If you want a Index you need(?) to decrypt
it in your Indexkey else you can not be shure your data is "sorted"
.... so in your Index all is "readable" !?
> How can I do to found a name using s or locate?
if you only search for 1 Record SEEK(myCryptName) shoud work, but
Records before/after are not "sorted"
> How can I do do browse the dbf with tbrosedb?
just put DeCrypt() into your Codeblock for you field
greetings by OHR
Jimmy
| |
|
| I sended you a private e-mail
I hope you receive it
Steel
"ReIncarnated" <manytimes@the_cinema.com> ha scritto nel messaggio
news:i6fup1p6ct28ilchivdqtqhjnkdbu5ah15@
4ax.com...
> I have a program (written many moons ago) that can insert an encrypted
> data string into a compiled EXE for you.
>
> This system is also used to keep track of clients versions and
> permanently brand the EXE.
>
> If you are interested in it, email me at
>
> i underscore think underscore your at hotmail dot com
>
> (replace the obvious in the above email address)
>
> It isn't used for a password, but is used for ensuring only the
> registered owner of the software can use it.
>
> On Tue, 13 Dec 2005 17:09:49 GMT, "Steel" <steel@nonspam.com> wrote:
>
> John.
| |
| Dave P 2005-12-14, 6:55 pm |
| Step 1 Encrypt the whole database
function fieldencrypt(cfieldname,cdata)
fieldput(encrypt(cFieldname,cdata))
function Fielddecrypt(cfieldname)
return decrypt(fieldget(cFieldname))
indexing depends on how you want this
index on &("decrypt(fieldget(cFieldnam))") too (somefile)
//browsing
you have too decrypt all columns
your system will be slower than anything....why do you want too encrypt
everything....
AUGE_OHR" <AUGE_OHR_NOSPAM_@CSI.COM> wrote in message
news:dnpe2l$cu6$00$1@news.t-online.com...
> hi,
>
> name.cdx
>
> that the point of a "crypt" DBF. If you want a Index you need(?) to
decrypt
> it in your Indexkey else you can not be shure your data is "sorted"
>
> ... so in your Index all is "readable" !?
>
>
> if you only search for 1 Record SEEK(myCryptName) shoud work, but
> Records before/after are not "sorted"
>
>
> just put DeCrypt() into your Codeblock for you field
>
> greetings by OHR
> Jimmy
>
>
>
|
|
|
|
|