

Saki wrote: ↑ Mon 8:57 pmThis is a static salt. Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow MessageRequester("Hint", "Decrypted Image not usable") WindowHeight(window_ID)/2-ImageHeight(image_ID)/2, WindowWidth(window_ID)/2-ImageWidth(image_ID)/2, If UCase(GetExtensionPart(source_path_image$))"GIF" : ResizeImage(image_ID, 300, 300) : EndIfĭefine image_gadget_ID=ImageGadget(#PB_Any, If recreate_image_file : If Not image_ID : MessageRequester("Hint", "Can not create a decrypted image") : EndIf : End : EndIfĭefine window_ID=OpenWindow(#PB_Any, 0, 0, 650, 400, "Decrypted Image", #PB_Window_SystemMenu|#PB_Window_ScreenCentered) UsePNGImageDecoder() : UseJPEGImageDecoder() : UseTIFFImageDecoder() : UseGIFImageDecoder()ĭefine recreate_image_file=0 Recreate a decrypted image from a encrypted imageĭefine image_ID=LoadImage_and_Decrypt_BF(source_path_image$, password$, recreate_image_file) If Not image_ID : ProcedureReturn -6 : EndIf : ProcedureReturn image_ID Protected image_ID=CatchImage(#PB_Any, *buffer_1, length) : FreeMemory(*buffer_1) If WriteData(file, *buffer_1, length)length : CloseFile(file) : FreeMemory(*buffer_1) : ProcedureReturn -22 : EndIf If Not file : ProcedureReturn -21 : EndIf Source_path_image$=RemoveString(source_path_image$, crypt_extender$, #PB_String_NoCase)įile=CreateFile(#PB_Any, source_path_image$) If Not AESDecoder(*buffer, *buffer_1, length, 256, #PB_Cipher_CBC)įreeMemory(*buffer) : FreeMemory(*buffer_1) : CloseFile(file) : ProcedureReturn -9 Protected *buffer_1=AllocateMemory(length) : If Not *buffer_1 : FreeMemory(*buffer) : ProcedureReturn -9 : EndIf If ReadData(file, *buffer, length)length : FreeMemory(*buffer) : CloseFile(file) : ProcedureReturn -21 : EndIf Repeat 32 2))) : ii+SizeOf(character)16 : CloseFile(file) : ProcedureReturn -21 : EndIf : FileSeek(file, 0)

Protected fixed$=StringFingerprint(password$+"%$(s4DäÖÄö", #PB_Cipher_SHA3), i, ii : Dim register.q(5) UseSHA3Fingerprint() By Saki - Advanced AES CBC mode image Decrypter with crypt randomized IV Procedure LoadImage_and_Decrypt_BF(source_path_image$, password$, recreate_file=0, crypt_extender$=" ")

LoadImage_Encrypt_and_Save_BF(source_path_image$, destination_path_image$, password$)

Repeat 32 2))) : ii+SizeOf(character)length+16 : FreeMemory(*buffer_1) : CloseFile(file) : ProcedureReturn -22 : EndIfĭefine source_path_image$=OpenFileRequester("Select a image", "", "", 0) : If source_path_image$="" : End : EndIfĭefine destination_path_image$=source_path_image$ Protected extension$="."+GetExtensionPart(source_path_image$)ĭestination_path_image$=GetPathPart(source_path_image$)+GetFilePart(source_path_image$)ĭestination_path_image$=RemoveString(destination_path_image$, extension$) : destination_path_image$+crypt_extender$+extension$ Protected fixed$=StringFingerprint(password$+"%$(s4DäÖÄö", #PB_Cipher_SHA3), i, ii, *buffer : Dim register.q(5) UseSHA3Fingerprint() By Saki - Advanced AES CBC mode image Encrypter with crypt randomized IV Procedure LoadImage_Encrypt_and_Save_BF(source_path_image$, destination_path_image$, password$, crypt_extender$=" ")
