ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Encrypt
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

masrnet2006

Saudi Arabia
59 Posts

Posted - Dec 05 2012 :  04:32:35  Show Profile  Reply
ImageEnView1.Proc.Encrypt(Captiva);
ImageEnView1.Proc.Decrypt( Captiva );
-----------------------------------
Encrypt is not good you can sea the image in the windows photo viewer


masrnet2006

Saudi Arabia
59 Posts

Posted - Dec 11 2012 :  04:58:38  Show Profile  Reply
ImageEnView1.Proc.Encrypt(Captiva);
ImageEnView1.Proc.Decrypt( Captiva );
-----------------------------------
Encrypt is not good you can sea the image in the windows photo viewer
Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 11 2012 :  10:19:35  Show Profile  Reply
When I encrypt an image with ImageEnView1.Proc.Encrypt here the original image is not visible in ImageEn or in windows photo viewer or any other viewer with Windows 7.

If you are calling ImageEnView1.Proc.Encrypt('Captiva') Immediately followed by ImageEnView1.Proc.Decrypt('Captiva') you are encrypting the image then immediately unencrypting the image. Just call ImageEnView1.Proc.Encrypt('Captiva') to encrypt it.
Encryped image

60.2 KB
Original Image

83.83 KB
Does your image become scrambled when you encrypt the image with ImageEnView1.Proc.Encrypt('Captiva') when viewing the image in ImageEnView1?

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

masrnet2006

Saudi Arabia
59 Posts

Posted - Dec 11 2012 :  23:58:46  Show Profile  Reply
please Encrypt this image end test

Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 12 2012 :  07:12:55  Show Profile  Reply
This is the encrypted image:


314.23 KB

Your test image was a 24-bit with alphachannel lossy jpg file. I removed the alphachannel and saved as a lossless format before enctypting the image. The image should be saved using lossless formats and in full rgb color spaces (no palette).

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

masrnet2006

Saudi Arabia
59 Posts

Posted - Dec 22 2012 :  02:02:10  Show Profile  Reply
APPLICATION Encrypt Demo IN SAMPLE
IF Encrypt AND SAVE *.JPG AND CLOSE APP. AND OPEN NOT DECRYPT WORK
BUT SAVE *.PNG OR TIF WORK GOOD
Go to Top of Page

fab

1310 Posts

Posted - Dec 22 2012 :  08:29:12  Show Profile  Reply
As specified in the documentation you CANNOT use LOSSY formats (like jpeg or tiff-jpeg).
Go to Top of Page

masrnet2006

Saudi Arabia
59 Posts

Posted - Jan 14 2013 :  04:09:44  Show Profile  Reply
procedure TForm1.EncryptBMP(const BMP: TBitmap; Key: Integer);
var
  BytesPorScan: Integer;
  w, h: integer;
  p: pByteArray;
begin
  try
    BytesPorScan := Abs(Integer(BMP.ScanLine[1]) -
      Integer(BMP.ScanLine[0]));
  except
    raise Exception.Create('Error');
  end;
  RandSeed := Key;
  for h := 0 to BMP.Height - 1 do
  begin
    P := BMP.ScanLine[h];
    for w := 0 to BytesPorScan - 1 do
      P^[w] := P^[w] xor Random(256);
  end;
end;

------------------
procedure TForm1.btn_encrypt_1Click(Sender: TObject);
begin
 EncryptBMP(ImageEnView1.Bitmap, 623);
 ImageEnView1.Refresh;
  ImageEnView1.IO.SaveToFile('C:\jpg_test\crypted_623.JPG');

end;
Go to Top of Page

masrnet2006

Saudi Arabia
59 Posts

Posted - Jan 14 2013 :  04:16:13  Show Profile  Reply
*.png is very good and Call the function again to decrypt it
EncryptBMP(ImageEnView1.Bitmap, 623);
ImageEnView1.Refresh;
ImageEnView1.IO.SaveToFile('C:\jpg_test\crypted_623.png');
Go to Top of Page

xequte

38616 Posts

Posted - Sep 11 2016 :  21:13:58  Show Profile  Reply
Hi

When using the Encrypt method, ensure you use the ieeaTEA2 algorithm.

Source



Older ieeaTEA Algorithm



ieeaTEA Algorithm



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: