1. luis avilan
  2. PowerBuilder
  3. Thursday, 26 March 2020
 
buenas Tardes
 
Al comprimir con el objecto CompressorObject y pasarle un password encriptado me devuelve
-2 -- The password entered is ilegal.
 
 
Este es el codigo utlizado
 
string ls_source, ls_target,ls_clave
Blob lblb_data
Blob lblb_key
Blob lblb_iv
Blob lblb_encrypt
Blob lblb_decrypt
string ls_data
CrypterObject Inv_CrypterObject
Inv_CrypterObject = CREATE  CrypterObject

debugbreak()
//// tomamos el valor a encriptar y lo pasamos a blob
ls_data = 'Test AES' //sle_1.text
lblb_data = Blob(ls_data, EncodingANSI!)
//
//// declaramos nuestra llave privada y publica
lblb_key = Blob("prue Key12345678", EncodingANSI!)
//// Encrypt data using AES
lblb_encrypt = Inv_CrypterObject.SymmetricEncrypt(AES!, lblb_data, lblb_key)
///////////////////////////
ls_clave =string(lblb_encrypt)
ls_source = "C:\Users\luisavilan\Documents\readme.txt"
ls_target = "C:\Users\luisavilan\Documents\comprimir"
lnv_compress = create CompressorObject
lnv_compress.password = ls_clave
li_return = lnv_compress.Compress(ls_source,ls_target, ArchiveFormatZIP!)
messagebox("",li_return)
 
-2 -- The password entered is ilegal.
Who is viewing this page
luis avilan Accepted Answer Pending Moderation
0
Votes
Undo

Saludos Govinda 

 

Me da el mismo resultado

 

CrypterObject Inv_CrypterObject
Inv_CrypterObject = CREATE  CrypterObject

debugbreak()
//// tomamos el valor a encriptar y lo pasamos a blob
ls_data = 'Test AES' //sle_1.text
lblb_data = Blob(ls_data, EncodingUTF8!)
//
//// declaramos nuestra llave privada y publica
lblb_key = Blob("prue Key12345678", EncodingUTF8!)
//// Encrypt data using AES
lblb_encrypt = Inv_CrypterObject.SymmetricEncrypt(AES!, lblb_data, lblb_key)
///////////////////////////
ls_clave =string(lblb_encrypt,EncodingUTF8!)
ls_source = "C:\Users\luisavilan\Documents\readme.txt"
ls_target = "C:\Users\luisavilan\Documents\comprimir"
lnv_compress = create CompressorObject
lnv_compress.password = ls_clave
li_return = lnv_compress.Compress(ls_source,ls_target, ArchiveFormatZIP!)
messagebox("",li_return)
Comment
There are no comments made yet.
  1. Friday, 27 March 2020
  2. PowerBuilder
  3. # 1
Govinda Lopez @Appeon Accepted Answer Pending Moderation
0
Votes
Undo

Luis:

 

Intenta cambiar todo por EncodingUTF8!

 

Saludos,

Comment
There are no comments made yet.
  1. Friday, 27 March 2020
  2. PowerBuilder
  3. # 2
luis avilan Accepted Answer Pending Moderation
0
Votes
Undo

Buenas Tardes Govinda 

 

Igual yo lo tenia así y nada

Comment
There are no comments made yet.
  1. Thursday, 26 March 2020
  2. PowerBuilder
  3. # 3
Govinda Lopez @Appeon Accepted Answer Pending Moderation
0
Votes
Undo

Hola Luis,

 

Intenta cambiar la siguiente línea de código:

 

ls_clave =string(lblb_encrypt)

 

por

 

ls_clave =string(lblb_encrypt, EncodingANSI!)

 

 

Saludos,

Comment
There are no comments made yet.
  1. Thursday, 26 March 2020
  2. PowerBuilder
  3. # 4
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.