{ Analytica Model Example_of_Encrypt_and_Decrypt, encoding="UTF-8" } SoftwareVersion 7.2.1 { System Variables with non-default values: } SampleSize := 1000 TypeChecking := 1 Checking := 1 SaveOptions := 2 SaveValues := 0 {!-50299|DiagramColor Model: 0x00ffffff} {!-50299|DiagramColor Module: 0x00ffffff} {!-50299|DiagramColor LinkModule: 0x00ffffff} {!-50299|DiagramColor Library: 0x00ffffff} {!-50299|DiagramColor LinkLibrary: 0x00ffffff} {!-50299|DiagramColor Form: 0x00ffffff} NodeInfo FormNode: 1,0,0,,0,0,,,,0,,,0 {!-50299|NodeColor Text: 0x00f3f3f3} Model Example_of_Encrypt_and_Decrypt Title: Example of Encrypt and Decrypt Description: This illustrates a simple usage of Encrypt and Decrypt. Note that we have imported from the Crypto namespace. Author: Lonnie Chrisman, Ph.D.~ Lumina Decision Systems Date: Tue, Sep 22, 2026 9:44 AM DiagState: 2,0,1,1447,558,17,10 WindState: 2,98,82,720,350 FontStyle: Arial,15 FileInfo: 0,Model Example_of_Encrypt_and_Decrypt,2,2,0,0,W:\Testmodels\Example of Encrypt and Decrypt.ana {!60500|NamespaceImports: Crypto} {!70104|Att_GUID: d8dd5193-e6f1-400c-a4c7-7bac92071a36} Index I Title: I Definition: 1..100 NodeLocation: 160,96,1 NodeSize: 64,24 Variable bytes Title: bytes Definition: Random(Uniform(0,255,integer:true,over:I)) NodeLocation: 320,96,1 NodeSize: 64,24 ValueState: 2,466,211,416,303,,MIDM Variable blob Title: blob Definition: WriteBinaryFile("<>",bytes,I,bytesPer:1,typeFlags:1) NodeLocation: 488,96,1 NodeSize: 64,24 ValueState: 2,148,154,416,303,,MIDM Variable key Title: key Definition: EncryptionKey() NodeLocation: 320,184,1 NodeSize: 64,24 ValueState: 2,260,266,416,303,,MIDM Variable Encrypted_blob Title: Encrypted blob Definition: Encrypt(blob,key,format:'base64') NodeLocation: 488,184,1 NodeSize: 64,24 ValueState: 2,292,298,986,251,,MIDM Variable Decrypted Title: Decrypted Definition: Decrypt(Encrypted_blob, key) NodeLocation: 488,256,1 NodeSize: 64,24 ValueState: 2,324,330,416,303,,MIDM Variable Exploded_bytes Title: Exploded bytes Definition: GetFromBinaryData(Decrypted, bytesPer:1, typeFlags:0, resultIndex:I) NodeLocation: 664,256,1 NodeSize: 64,24 ValueState: 2,356,362,416,303,,MIDM Variable same_blob_ Title: same blob? Definition: blob=Decrypted NodeLocation: 672,184,1 NodeSize: 64,24 ValueState: 2,340,346,416,303,,MIDM Objective Correctly_recovered_ Title: Correctly recovered? Definition: Min(Exploded_bytes=bytes,I) NodeLocation: 664,344,1 NodeSize: 64,24 ValueState: 2,372,378,416,303,,MIDM Variable Some_text Title: Some text Definition: "Now is the time for all good men to come to the aid of their country" NodeLocation: 328,432,1 NodeSize: 64,24 Variable Encrypted_text Title: Encrypted text Definition: Encrypt(Some_text, key) NodeLocation: 496,432,1 NodeSize: 64,24 ValueState: 2,132,138,416,303,,MIDM Variable Recovered_text Title: Recovered text Definition: Decrypt(Encrypted_text,key) NodeLocation: 672,432,1 NodeSize: 64,24 ValueState: 2,148,154,944,167,,MIDM Variable Encrypted_text2 Title: Encrypted text2 Definition: Encrypt(Some_text, key, format:'base64') NodeLocation: 496,496,1 NodeSize: 64,24 ValueState: 2,100,106,416,303,,MIDM Variable Recovered_text1 Title: Recovered text Definition: Decrypt(Encrypted_text2, key, format:'base64') NodeLocation: 672,496,1 NodeSize: 64,24 ValueState: 2,116,122,416,303,,MIDM Close Example_of_Encrypt_and_Decrypt