RE: [U2] Encrypt issue 8088

2006-08-30 Thread george r smith
Baker,
I'm the guy who had to implement because of unidata version on the command
line, so if you would send me a copy of your program I will keep it for the
future.

thanks
george

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:owner-u2-
 [EMAIL PROTECTED] On Behalf Of Baker Hughes
 Sent: Friday, August 25, 2006 3:12 PM
 To: u2-users@listserver.u2ug.org
 Subject: RE: [U2] Encrypt issue 8088
 
 Symeon, others,
 
 I tested every 128+ bit cipher available with Encrypt and here are the
 results:
 All the ciphers work with encoding but require the workaround (remove
 extra LF).
 None work without encoding - the decrypt side either adds a random
 character, or craters altogether, and Decrypted string never matches raw
 string.
 
 If anyone wants a copy of my test program 'ENCRYPT.THIS' write me
 off-line.
 I also have spreadsheet of the testing results, comparing the
 accuracy/functionality of the ciphers.
 
 
 
 Encryption Testing program :ENCRYPT.THIS
 Choose from one of the available Ciphers
 1) rc4  2) des-ede3-cbc 3) des-ede3-cfb 4)
 des-ede3-ofb
 5) rc2-cbc  6) rc2-ecb  7) rc2-cfb  8) rc2-ofb
 9) rc5-cbc  10) rc5-cfb 11) rc5-ecb 12) rc5-ofb
 
 Enter Cipher choice 1 - 12 :1
 Enter Action - 1=Encrypt only, 2=Encrypt  Decode :2
 Data String :40550111
 ___Encrypting___
 ___
 There was an extra line feed, now removed from result.
 Encrypted Successfully !
 The Encrypt result is fdYWmfhZkszPfLGo+XsPQA==
 ___Decrypting___
 ___
 Decrypted Successfully !
 Decrypted result is 40550111
 Original data and decrypted data match, hooray!
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Symeon Breen
 Sent: Friday, August 25, 2006 1:06 AM
 To: u2-users@listserver.u2ug.org
 Subject: Re: [U2] Encrypt issue 8088
 
 Here is my standard crypt sub
 
 
FUNCTION AD.CRYPT(Word,key,iv)
 * Function to crypt something i.e. a password
 * a2c limited, Oct2005
 
Crypt=Word
 
Err='';result='';resLoc=1;salt=''
 
algorithm=rc2-cbc
 
Err=ENCRYPT(algorithm,2,Word,1,key,1,1,salt,iv,result,resLoc)
 
IF NOT(Err) THEN
   IF result[LEN(result),1]=CHAR(10) THEN
 result=result[1,LEN(result)-1]
 ;* IBM ISSUE 8088
   Crypt=result
END
 
RETURN Crypt
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Encrypt issue 8088

2006-08-25 Thread Symeon Breen
Here is my standard crypt sub


   FUNCTION AD.CRYPT(Word,key,iv)
* Function to crypt something i.e. a password
* a2c limited, Oct2005

   Crypt=Word

   Err='';result='';resLoc=1;salt=''

   algorithm=rc2-cbc

   Err=ENCRYPT(algorithm,2,Word,1,key,1,1,salt,iv,result,resLoc)

   IF NOT(Err) THEN
  IF result[LEN(result),1]=CHAR(10) THEN result=result[1,LEN(result)-1]
;* IBM ISSUE 8088
  Crypt=result
   END

   RETURN Crypt
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Encrypt issue 8088

2006-08-25 Thread David A. Green
Why do programmers use result[LEN(result),1]? Doesn't result[1] do the same
thing but easier, quicker, and more readable?

Thanks,
David A. Green
DAG Consulting
www.dagconsulting.com

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Symeon Breen
Sent: Friday, August 25, 2006 1:06 AM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Encrypt issue 8088

Here is my standard crypt sub


   FUNCTION AD.CRYPT(Word,key,iv)
* Function to crypt something i.e. a password
* a2c limited, Oct2005

   Crypt=Word

   Err='';result='';resLoc=1;salt=''

   algorithm=rc2-cbc

   Err=ENCRYPT(algorithm,2,Word,1,key,1,1,salt,iv,result,resLoc)

   IF NOT(Err) THEN
  IF result[LEN(result),1]=CHAR(10) THEN result=result[1,LEN(result)-1]
;* IBM ISSUE 8088
  Crypt=result
   END

   RETURN Crypt
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Encrypt issue 8088

2006-08-25 Thread Allen Egerton

David A. Green wrote:

Why do programmers use result[LEN(result),1]? Doesn't result[1] do the same
thing but easier, quicker, and more readable?

snip

variable[1] to reference the last byte of variable is a relatively 
recent addition to Universe.  Where relatively refers to the lifeline 
of the Pick/PI/U2 product family.


So you'll typically see it either in older code, or in code written by 
guys who've been programming a while and haven't picked up on all of the 
newer facilities.


I vaguely remember it being introduced and enjoying the fact that I 
could write less code and have it more readable.  So it became one of 
the things I tended to retrofit as I was working on existing code, not 
worth looking for, but worth cleaning up while I was in the neighborhood.


--
Allen
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Encrypt issue 8088

2006-08-25 Thread Baker Hughes
RESULT[1] does work the same, at least on UV10.0 - maybe some have
concern on cross-platform portability.

And Symeon - thanks for your code fragment.  That, and a nights rest
helped me to get things going.  I'll post the encryption code that's now
working if anyone is interested.  It may be of use to anyone who later
faces the same unresolved issue 8088.

Many thanks. 

R. Baker Hughes
UniVerse Programming
Mouser Electronics, Inc.
(817) 804-3598 *
[EMAIL PROTECTED] *

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David A. Green
Sent: Friday, August 25, 2006 10:07 AM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Encrypt issue 8088

Why do programmers use result[LEN(result),1]? Doesn't result[1] do the
same thing but easier, quicker, and more readable?

Thanks,
David A. Green
DAG Consulting
www.dagconsulting.com

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Symeon Breen
Sent: Friday, August 25, 2006 1:06 AM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Encrypt issue 8088

Here is my standard crypt sub


   FUNCTION AD.CRYPT(Word,key,iv)
* Function to crypt something i.e. a password
* a2c limited, Oct2005

   Crypt=Word

   Err='';result='';resLoc=1;salt=''

   algorithm=rc2-cbc

   Err=ENCRYPT(algorithm,2,Word,1,key,1,1,salt,iv,result,resLoc)

   IF NOT(Err) THEN
  IF result[LEN(result),1]=CHAR(10) THEN
result=result[1,LEN(result)-1]
;* IBM ISSUE 8088
  Crypt=result
   END

   RETURN Crypt
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Encrypt issue 8088

2006-08-25 Thread Baker Hughes
Symeon, others,

I tested every 128+ bit cipher available with Encrypt and here are the
results:
All the ciphers work with encoding but require the workaround (remove
extra LF).
None work without encoding - the decrypt side either adds a random
character, or craters altogether, and Decrypted string never matches raw
string.

If anyone wants a copy of my test program 'ENCRYPT.THIS' write me
off-line.
I also have spreadsheet of the testing results, comparing the
accuracy/functionality of the ciphers.



Encryption Testing program :ENCRYPT.THIS
Choose from one of the available Ciphers
1) rc4  2) des-ede3-cbc 3) des-ede3-cfb 4)
des-ede3-ofb
5) rc2-cbc  6) rc2-ecb  7) rc2-cfb  8) rc2-ofb
9) rc5-cbc  10) rc5-cfb 11) rc5-ecb 12) rc5-ofb

Enter Cipher choice 1 - 12 :1
Enter Action - 1=Encrypt only, 2=Encrypt  Decode :2
Data String :40550111
___Encrypting___
___
There was an extra line feed, now removed from result.
Encrypted Successfully !
The Encrypt result is fdYWmfhZkszPfLGo+XsPQA==
___Decrypting___
___
Decrypted Successfully !
Decrypted result is 40550111
Original data and decrypted data match, hooray!

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Symeon Breen
Sent: Friday, August 25, 2006 1:06 AM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Encrypt issue 8088

Here is my standard crypt sub


   FUNCTION AD.CRYPT(Word,key,iv)
* Function to crypt something i.e. a password
* a2c limited, Oct2005

   Crypt=Word

   Err='';result='';resLoc=1;salt=''

   algorithm=rc2-cbc

   Err=ENCRYPT(algorithm,2,Word,1,key,1,1,salt,iv,result,resLoc)

   IF NOT(Err) THEN
  IF result[LEN(result),1]=CHAR(10) THEN
result=result[1,LEN(result)-1]
;* IBM ISSUE 8088
  Crypt=result
   END

   RETURN Crypt
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


[U2] Encrypt issue 8088

2006-08-24 Thread Baker Hughes
Hi,

Can anyone share a code fragment for removing the extra Char(10)
characters from the Encrypt function.

I've studied the IBM articles (2) on U2 Encryption, and read the
previous posts on this list.  I've tried to remove the extra LF with
less than sterling results.  I can't find the char(10), whether I do or
don't encode.  If I add an extra char(10) for Decrypt it overruns the
expected length and craters.

Before I resort to shelling out to Unix and running Openssl I'd like to
exhaust the native U2 Encrypt possibility.

We are on UniVerse 10.0 - the articles by Nik Kesic speculate that the
Encrypt patch will arrive in 10.2, but I'm not certain when/if we'll
load 10.2 anyway.

Always enlightening reading this list. I'm thankful for you guys (in the
NY sense of the word, inclusive of gals)[Y'all, for other Southerners.]

TIA,
-Baker 


R. Baker Hughes
UniVerse Programming
Mouser Electronics, Inc.
(817) 804-3598 *
[EMAIL PROTECTED] *
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Encrypt issue 8088

2006-08-24 Thread george r smith
Baker,

I don't know if you are trying to do this via a Unibasic subroutine call or
by using EXECUTE. I could not use the Unibasic because the Unidata version
was not 7.1 so I used the following. I had a lot of trouble with char(10)
also until I found the -a -A flags.

This works well on Solaris and Unidata 6.0. I sure you can see the command
we are EXECUTING and capturing the result.

george

CMD = 
CMD = echo :   PKT
CMD := |openssl enc -a -A
CMD :=  -iv :  IV
CMD :=  -: ALGORITHM
CMD :=  -K :   KEY
CMD :=  -out : PATH
CMD := /:  FILE.NAME

 CMD = 
 CMD = openssl enc -d -a -A
 CMD :=  -iv :  IV
 CMD :=  -: ALGORITHM
 CMD :=  -K :   KEY
 CMD :=  -in :  PATH
 CMD := /:  FILE.NAME


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:owner-u2-
 [EMAIL PROTECTED] On Behalf Of Baker Hughes
 Sent: Thursday, August 24, 2006 9:35 AM
 To: u2-users@listserver.u2ug.org
 Subject: [U2] Encrypt issue 8088
 
 Hi,
 
 Can anyone share a code fragment for removing the extra Char(10)
 characters from the Encrypt function.
 
 I've studied the IBM articles (2) on U2 Encryption, and read the
 previous posts on this list.  I've tried to remove the extra LF with
 less than sterling results.  I can't find the char(10), whether I do or
 don't encode.  If I add an extra char(10) for Decrypt it overruns the
 expected length and craters.
 
 Before I resort to shelling out to Unix and running Openssl I'd like to
 exhaust the native U2 Encrypt possibility.
 
 We are on UniVerse 10.0 - the articles by Nik Kesic speculate that the
 Encrypt patch will arrive in 10.2, but I'm not certain when/if we'll
 load 10.2 anyway.
 
 Always enlightening reading this list. I'm thankful for you guys (in the
 NY sense of the word, inclusive of gals)[Y'all, for other Southerners.]
 
 TIA,
 -Baker
 
 
 R. Baker Hughes
 UniVerse Programming
 Mouser Electronics, Inc.
 (817) 804-3598 *
 [EMAIL PROTECTED] *
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Encrypt issue 8088

2006-08-24 Thread Baker Hughes
George,

Thanks for this help.  I'll save this in case we have to resort to a
Unix script and run openssl.  We are rather strict about not allowing a
user logon 'EXECUTE' a Unix shell script with UniVerse.  But, if I can't
find a solution for the UV native ENCRYPT function [issue 8088] then we
may have to write a Unix script that would be called from a subroutine.

Thanks for your contribution, and for the -a -A flag point you make.


R. Baker Hughes
UniVerse Programming
Mouser Electronics, Inc.
(817) 804-3598 *
[EMAIL PROTECTED] *

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of george r smith
Sent: Thursday, August 24, 2006 11:22 AM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Encrypt issue 8088

Baker,

I don't know if you are trying to do this via a Unibasic subroutine call
or by using EXECUTE. I could not use the Unibasic because the Unidata
version was not 7.1 so I used the following. I had a lot of trouble with
char(10) also until I found the -a -A flags.

This works well on Solaris and Unidata 6.0. I sure you can see the
command we are EXECUTING and capturing the result.

george

CMD = 
CMD = echo :   PKT
CMD := |openssl enc -a -A
CMD :=  -iv :  IV
CMD :=  -: ALGORITHM
CMD :=  -K :   KEY
CMD :=  -out : PATH
CMD := /:  FILE.NAME

 CMD = 
 CMD = openssl enc -d -a -A
 CMD :=  -iv :  IV
 CMD :=  -: ALGORITHM
 CMD :=  -K :   KEY
 CMD :=  -in :  PATH
 CMD := /:  FILE.NAME


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:owner-u2- 
 [EMAIL PROTECTED] On Behalf Of Baker Hughes
 Sent: Thursday, August 24, 2006 9:35 AM
 To: u2-users@listserver.u2ug.org
 Subject: [U2] Encrypt issue 8088
 
 Hi,
 
 Can anyone share a code fragment for removing the extra Char(10) 
 characters from the Encrypt function.
 
 I've studied the IBM articles (2) on U2 Encryption, and read the 
 previous posts on this list.  I've tried to remove the extra LF with 
 less than sterling results.  I can't find the char(10), whether I do 
 or don't encode.  If I add an extra char(10) for Decrypt it overruns 
 the expected length and craters.
 
 Before I resort to shelling out to Unix and running Openssl I'd like 
 to exhaust the native U2 Encrypt possibility.
 
 We are on UniVerse 10.0 - the articles by Nik Kesic speculate that the

 Encrypt patch will arrive in 10.2, but I'm not certain when/if we'll 
 load 10.2 anyway.
 
 Always enlightening reading this list. I'm thankful for you guys (in 
 the NY sense of the word, inclusive of gals)[Y'all, for other 
 Southerners.]
 
 TIA,
 -Baker
 
 
 R. Baker Hughes
 UniVerse Programming
 Mouser Electronics, Inc.
 (817) 804-3598 *
 [EMAIL PROTECTED] *
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Encrypt issue 8088

2006-08-24 Thread Allen E. Elwood
Wouldn't change be a little easier?

RESULT = CHANGE(RESULT,CHAR(10), '')

hth,
Allen

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Rajesh Menon
Sent: Thursday, August 24, 2006 12:22
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Encrypt issue 8088


This is how I remove the char(10) from the encrypted data:
LN = LEN(RESULT)
IF RESULT[LN,1] = CHAR(10) THEN
RESULT=RESULT[1,LN-1]
END
To decrypt this data, I add CHAR(10) before passing it to the ENCRYPT
function.
DATA = DATA:CHAR(10)

HTH
Rajesh
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:owner-u2-
 [EMAIL PROTECTED] On Behalf Of Baker Hughes
 Sent: Thursday, August 24, 2006 9:35 AM
 To: u2-users@listserver.u2ug.org
 Subject: [U2] Encrypt issue 8088
 
 Hi,
 
 Can anyone share a code fragment for removing the extra Char(10)
 characters from the Encrypt function.
 
 I've studied the IBM articles (2) on U2 Encryption, and read the
 previous posts on this list.  I've tried to remove the extra LF with
 less than sterling results.  I can't find the char(10), whether I do or
 don't encode.  If I add an extra char(10) for Decrypt it overruns the
 expected length and craters.
 
 Before I resort to shelling out to Unix and running Openssl I'd like to
 exhaust the native U2 Encrypt possibility.
 
 We are on UniVerse 10.0 - the articles by Nik Kesic speculate that the
 Encrypt patch will arrive in 10.2, but I'm not certain when/if we'll
 load 10.2 anyway.
 
 Always enlightening reading this list. I'm thankful for you guys (in the
 NY sense of the word, inclusive of gals)[Y'all, for other Southerners.]
 
 TIA,
 -Baker
 
 
 R. Baker Hughes
 UniVerse Programming
 Mouser Electronics, Inc.
 (817) 804-3598 *
 [EMAIL PROTECTED] *
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Encrypt issue 8088

2006-08-24 Thread Rajesh Menon
This is how I remove the char(10) from the encrypted data:
LN = LEN(RESULT)
IF RESULT[LN,1] = CHAR(10) THEN
RESULT=RESULT[1,LN-1]
END
To decrypt this data, I add CHAR(10) before passing it to the ENCRYPT
function.
DATA = DATA:CHAR(10)

HTH
Rajesh
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:owner-u2-
 [EMAIL PROTECTED] On Behalf Of Baker Hughes
 Sent: Thursday, August 24, 2006 9:35 AM
 To: u2-users@listserver.u2ug.org
 Subject: [U2] Encrypt issue 8088
 
 Hi,
 
 Can anyone share a code fragment for removing the extra Char(10)
 characters from the Encrypt function.
 
 I've studied the IBM articles (2) on U2 Encryption, and read the
 previous posts on this list.  I've tried to remove the extra LF with
 less than sterling results.  I can't find the char(10), whether I do or
 don't encode.  If I add an extra char(10) for Decrypt it overruns the
 expected length and craters.
 
 Before I resort to shelling out to Unix and running Openssl I'd like to
 exhaust the native U2 Encrypt possibility.
 
 We are on UniVerse 10.0 - the articles by Nik Kesic speculate that the
 Encrypt patch will arrive in 10.2, but I'm not certain when/if we'll
 load 10.2 anyway.
 
 Always enlightening reading this list. I'm thankful for you guys (in the
 NY sense of the word, inclusive of gals)[Y'all, for other Southerners.]
 
 TIA,
 -Baker
 
 
 R. Baker Hughes
 UniVerse Programming
 Mouser Electronics, Inc.
 (817) 804-3598 *
 [EMAIL PROTECTED] *
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/