Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Type of field to store encrypted value
Message
 
 
To
03/04/2019 11:36:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01667839
Message ID:
01667888
Views:
40
>>>>>>Hi,
>>>>>>
>>>>>>I am using cipher() function to encrypt a long string (250 char). Then I need to store the encrypted value into a field of a SQL Server table. Can the field be type CHAR(250)? or it must be NCHAR(250)?
>>>>>>
>>>>>>TIA
>>>>>
>>>>>I would ditto on Naomi, it should be binary, unless you also convert it to base64 encoded value. Otherwise, you are in danger of losing data, be it char or nchar. BTW cipher() function, what is that? I only assumed it was something doing encryption using one the known algorithms.
>>>>
>>>>Yes, cipher() is a function that does encryption. Sergey Berezniker converted it from C to VFP some many years ago. I don't know who wrote the original (C-version) of this function.
>>>
>>>Is that a special encryption algorithm that never return non-printable characters and also with an exact size? If so you can use char(N). nchar() uses unicode.
>>>
>>>If it might return a non-printable character and size is not fixed (both case are the usual cases with encryption algorithms) then varbinary(N) or varbinary(MAX) is the choice. You might instead use varchar(Max), provided you are converting the value to base64 encoded - StrConv(encrypted, 13).
>>
>>I don't know the answers to these questions. Here is an example of the encrypted string:
>>
>>xvneoUNC7ùêæĵ˜†]T>"Ûͪ“m|+ 缨pMöûžjBÓ±zIǼw9öŒKÐ¥Ȑw¾q)ЗOý²PÇlûtÊs)¿f¯|ï•-ÎX§8ÖJ‰;Çgé| ™µEÏVîfëpíX‘‡3ø{÷\ç[ÕHð4­ˆËhÒ@³+…èW¿‡ïO¬>nË(ŠÕ>œòK‘õLŠäg„ð$kúe¿ç‚ÕM£ÄQ†éT–¸Õ*rƒßØ's¯¯s"Í–ŸsSÖÂ¥‚bq"êÏ㻆iwp-=ÔôÃج“¸´Šƒ«—–mo\
>>
>
>please pronounce that slowly.

:)
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform