CF9 encrypted with AES 256 bit, example anyone?

Hello. I am looking for an example of the Encrypt method using the AES 256 key.  I think I have the unlimited jurisdiction policy files force active.  And I always get the CFError

The specified key is not a valid key for encryption: illegal key size.

Now I've hit the wall, can not get.  What harm am I doing?  How can I check that policy files are installed and accessible to my CF file?  Any help is greatly appreciated.

< cfset thePlainText = "is this work for me?" / >

Generate the secret key (128): < cfset AES128 = "#generatesecretkey('AES',128) #" / > < cfdump var = "#AES128 #" > < BR >
Generate the secret key (192): < cfset AES192 = "#generatesecretkey('AES',192) #" / > < cfdump var = "#AES192 #" > < BR >
Generate the secret key (256): < cfset AES256 = "#generatesecretkey('AES',256) #" / > < cfdump var = "#AES256 #" > < BR > < BR >

< cfset = AES256 sequence / >
< cfset theAlgorithm = "AES/CBC/PKCS5Padding" / >
< cfset theEncoding = "base64" / >
< cfset theIV = BinaryDecode ("6d795465737449566f7253616c7431323538704c6173745f", "hex") / >

< cfset encryptedString = encrypt (thePlainText, sequence, theAlgorithm, theEncoding, theIV) / >

<!--> view results
< cfset keyLengthInBits = arrayLen (BinaryDecode (sequence, 'base64')) * 8 / >
< cfset ivLengthInBits = arrayLen (theIV) * 8 / >
< cfdump var = "" #variables # "label ="Results AES/CBC/PKCS5Padding"/ >"


< cfabort >

You probably don't have unlimited jurisdiction policy files to the right place.

It is very common for admins to think that new policy files go into the directory/lib to usual. But they real go into the directory/jre/security/lib to (unless you're on a Mac, then they go to JAVA_HOME/security/lib).

You also need to restart once you get in place policy files.

I tested your script on my local machine, which does not have the policy of unlimited strength and it worked fine.

Jason

Tags: ColdFusion

Similar Questions

  • encrypt/decrypt AES 256, error vorsalt

    Fanny.

    So I try to get encrypt/decrypt with AES 256, both key of 32 bytes and 32 bytes IVorSalt. (Well Yes new java security files installed v6)

    'IF' I have 32-bit keys but does not use an IV at all, I get a good result looking for the AES 256. (I can say that this is AES 256 by looking at the length of the encrypted channel)

    '' IF '' I use a 32-bit key and 16-bit salt, I get a result of AES 128 (I know - according to the docs two theyre if posed with the same size, but the docs are wrong).

    But when I switch to using two an 32-bit key AND a salt of 32 bytes, I get the below error.

    An error occurred during the attempt encrypt or decrypt your input string: bad parameters: invalid IvParameterSpec: com.rsa.jsafe.crypto.JSAFE_IVException: invalid IV length. Must be 16.

    Has anyone got ' EVER' encrypt to work for them using AES 256 key of 32 bytes and 32 bytes of salt? Is this a bug in CF? Or Java? Or I do something wrong?

    <!--- ////////////////////////////////////////////////////////////////////////// Here's the Code ///////////////////////////////////////////////////////////////////////// --->

    < cfset theAlgorithm = "Rijndael/CBC/PKCS5Padding" / >

    < cfset gKey = "hzj + 1o52d9N04JRsj3vTu09Q8jcX + fNmeyQZSDlZA5w =" > <!--these 2 are the same--> ".

    <!-< cfset gKey = ToBase64 (BinaryDecode ("8738fed68e7677d374e0946c8f7bd3bb4f50f23717f9f3667b2419483959039c", "Hex")) - > >

    < cfset theIV = BinaryDecode ("7fe8585328e9ac7b7fe8585328e9ac7b7fe8585328e9ac7b7fe8585328e9ac7b", "hex") >

    <! - < cfset theIV128 = BinaryDecode ("7fe8585328e9ac7b7fe8585328e9ac7b", "hex") > - >

    < name cffunction = "DoEncrypt" access = "public" returntype = index 'string' = "Fires when the application is first created." >

    < name cfargument = "szToEncrypt" type = "string" required = "true" / >

    < cfset secretkey = gKey >

    < cfset szReturn = encrypt (szToEncrypt, secretkey, theAlgorithm, 'Base64', theIV) >

    < cfreturn szReturn >

    < / cffunction >

    < name cffunction = "DoDecrypt" access = "public" returntype = index 'string' = "Fires when the application is first created." >

    < name cfargument = "szToDecrypt" type = "string" required = "true" / >

    < cfset secretkey = gKey >

    < cfset szReturn = decrypt (szToDecrypt, secretkey, theAlgorithm, 'Base64', theIV) >

    < cfreturn szReturn >

    < / cffunction >

    < cfset szStart form ["toencrypt'] = >

    < cfset szStart = 'Test me!' >

    < cfset szEnc = DoEncrypt (szStart) >

    < cfset szDec = DoDecrypt (szEnc) >

    < cfoutput > #szEnc # #szDec # < / cfoutput >

    If you do something wrong depends on what you're trying to do.

    When it comes to so-called AES 256 there are two options as to what this may mean.

    1. in the programming world, AES 256 means crypto AES with a 128-bit blocks and a 256-bit key size. The CBC IV should be the same size as the block, not the same size as the key. It should be 128-bit

    2. in some parts of the world programming (PHP, mainly) 256 AES is Rijndael crypto with a block size of 256 bits. The problem here is that it is NOT AES. It uses the MCRYPT_RIJNDAEL_256 algorithm. Rijndael is the algorithm on which AES has been built, but not everything Rijndael AES.

    So, if what you want is crypto AES 256 bit, then using a key of 256 bits with a 128-bit IV is the correct way to do it. AES * only * a 128-bit blocks. It is therefore neither a bug in Java or CF.

    If you really need the 256-bit block size, then I guess you are probably trying to interact with a system that uses PHP for crypto. If this is the case, I think that you need to dig the hard way in Java and make cryptography to support. You may also add new JCA/JCE Crypto Provider if none of the standard service providers included with CF has MCRYPT_RIJNDAEL_256.

    Good luck

    Jason

  • Your computer has been locked and all your files encrypted with RSA 2048-bit encryption.

    My computer has been hit by a ransomware (which is reported by Palo Alto Networks March 4, http://researchcenter.paloaltonetworks.com/2016/03/new-os-x-ransomware-keranger-infect es-transmission-bittorrent-client-...)

    What should I do to save my files?

    And how to remove the virus permanently?

    If you do not have a backup that has not been attached while the virus was busy to encrypt your data, I think it's too late now.

    To be absolutely sure that there is nothing left on the computer, the only way is from scratch.

  • Microsoft L2TP over IPSEC client with AES encryption

    I configured L2TP over IPSec Cisco VPN router with Hastings 3des encryption is sha1 with diffie hellman Group 2 and I can't connect with success of Microsoft customers.

    but my question is why can I not connect when I am increasing the encryption with AES 256 and sha256 DH group 14, his looks that windows does not support advanced encryption.

    is it possiple to activate encryption aes with the highest level...? and how?.

    Hello

    To ensure that you get the best response to your concerns, we suggest that publish this request via the Web to Microsoft Developer network site. To do this, visit this link.

    Best regards.

  • How can I specify a strong encryption algorithm (256-bit), but not a complete blood count?

    Environment:


    Oracle 11.2.0.3 EE on Solaris


    I apologize in advance, I'm not a person of security but I need to use a strong, 256-bit encryption algorithm, in my configuration of the MA (emd.properties), but it cannot be the CBC encryption in the supported list.


    According to the list in the MDTS. PROPERTIES file, that the encryption algorithms supported are:

    If not specified, the default list is:

    # SSL_RSA_WITH_RC4_128_MD5

    # SSL_RSA_WITH_RC4_128_SHA

    # SSL_RSA_WITH_3DES_EDE_CBC_SHA

    # SSL_RSA_WITH_DES_CBC_SHA

    # SSL_RSA_EXPORT_WITH_RC4_40_MD5

    # SSL_RSA_EXPORT_WITH_DES40_CBC_SHA

    #

    # is the supported list:

    # SSL_RSA_WITH_3DES_EDE_CBC_SHA

    # SSL_RSA_WITH_RC4_128_SHA

    # SSL_RSA_WITH_RC4_128_MD5

    # SSL_RSA_WITH_DES_CBC_SHA

    # SSL_RSA_EXPORT_WITH_RC4_40_MD5

    # SSL_RSA_EXPORT_WITH_DES40_CBC_SHA

    # SSL_RSA_WITH_AES_128_CBC_SHA

    # SSL_RSA_WITH_AES_256_CBC_SHA

    # SSL_DH_anon_WITH_3DES_EDE_CBC_SHA

    # SSL_DH_anon_WITH_RC4_128_MD5

    # SSL_DH_anon_WITH_DES_CBC_SHA


    I see only a 1 256-bit encryption in the list but unfortunately it is also a cipher CBC that I said is unacceptable.


    I'm not familiar with force other encryption algorithms.


    Y-at-all between them considered "strong" without being a complete blood count?


    Is it possible to import from other encryption algorithms 256-bit non - CBC?


    Thanks a lot for your help!


    -gary

    Our security staff I the use of 256-bit CBC encryption so I'm good.

    -gary

  • Equipped with Vista 32-bit, lost sound and cannot install the Realtek-get code 800705 b 4, can anyone help, BB _ @_. _, Thank you

    Equipped with Vista 32-bit, lost sound and cannot install the Realtek-get code 800705 b 4, can anyone help, BB * address email is removed from the privacy *, thank you

    How does this relate to the features of Windows Update?

  • Updated the motherboard, processor and RAM and upgraded to Windows 7 Ultimate 64 bit, after upgrade the external hard drive encrypted with bitlocker will not enter the password.

    Original title: bitllocker Windows 7 issue

    Hello

    I recently updated my motherboard, processor and RAM, but I kept my original 500 GB hard drive, and equipped with a hard drive 2 TB extra, after the upgrade, I downloaded windows 7 ultimate 64-bit. After the upgrade I plugged my external hard drive (which has all my stuff important on it, that is to say the photo, video etc.) to realize that I had he encrypted with bitlocker on my old sysem. It allows Me to enter my password, it looks for a USB flash drive key, I did not. My question is:

    Can I replace my old system with the old motherboard, hard drive and the original RAM to remove the external hard drive for bitlocker?

    I still have the file windows.old on my hard drive, I have to restore it and remove the most recent version of windows 7 off the drive. I do this before I rebuild my old PC? I'm stuck here and would not lose all my photos (the wife would kill me!) I would appreciate your help.

    Hello

    Reassembly of the old computer won't help. You will always need the key to open the Bitlocker.

    You can read the articles and check:

    What is the difference between BitLocker Drive encryption and EFS file system?

    Protect your files using BitLocker Drive encryption

    In Windows 7 BitLocker Drive Encryption: frequently asked Questions

    Hope the helps of information. Let us know if you need help with Windows related issues. We will be happy to help you.

  • ACCDB with CF9 under Win2008 R2 64-bit

    Hello

    I have an accdb designed with Access 2010 64-bit.

    I am running CF9 under Win2008 R2 64 bit.

    I also installed http://www.Microsoft.com/download/en/details.aspx?displaylang=en & ID = 13255

    Now I googled and tried a few things to get this combination work:

    so far - no way!

    Everyone fails to do and is at - there somewhere a description?

    Thanks for the help - Didi

    Ok. That was all then. We will go.

    I believe that our hopes now lie with JDBC. Because ColdFusion is a Java application, find a driver 32-bit and 64 - bit for MS Access will help many developers.

    My search led me to the driver JDBC of HXTT for MS Access. The only problem is, I couldn't tell if their pilot is to access 32-bit or 64-bit. It would (hopefully) universal, automatically detecting the system?

    (After the customary virus scan) I have unpacked their access.zip file, copied the required file Access_JDBC40. CONTAINER/access/lib/to the ColdFusion lib directory. That's all what you need to install the driver. I then took over ColdFusion.

    I went to the ColdFusion Administrator and configured a source of data as follows:

    Data Source name: myAccessDSN

    Pilot: other

    JDBC URL: jdbc:access:/C:/Users/BKBK/Documents/myDB.accdb

    Driver class: com.hxtt.sql.access.AccessDriver

    Driver name: com.hxtt.sql.access.AccessDriver

    It has worked flawlessly. But then again, although I installed everything you have done, I am on 32-bit access.

  • ASDM AES-256 not supported?

    Last night we went to upgrade our firewall so that only TLS1.x and AES-256/SHA-1 can be used for VPN connections in the box. After doing so, ASDM has stopped working, AnyConnect still works without problem.

    Java has reported an error in the SSL handshake. I went to reactivate the mechanisms of encryption one by one and determined that AES-128/SHA1 is the encryption algorithm above, sure I can connect via ASDM. I tried updating to the latest version of ASDM and 7.5 (2) doesn't connect on something higher to AES - 128. We use a certificate self-signed inside the interface, so I enabled ASDM on the outside where we have a third valid cert and tried connecting via https:///Admin to make sure it wasn't a certificate problem and no dice.

    It's a bit strange to me that ASDM only supports AES-256. I wonder if anyone has any ideas as to why I can't connect to AES-256 and/or workaround. It would also be allowed to use AES - 128 for the ASDM internally and AES - 256 connections for VPN connections; but I don't see any way to activate the SSL encryption on use by application methods, it seems that I can only configure them in the world and am therefore stuck with allow VPN connections to use AES - 128, if they wish (I made connections will negotiate to AES - 256 before attempting to AES - 128, but I would like to disable completely AES-128).

    Specs below, thank you in advance for your help.

    Plug

    ASA Version: 9.2 (2) 4

    ASDM Version: 7.4 (2), I also tried 7.5 (2)

    I thought about it and found an article that confirms my suspicions.

    ASDM is just a Java applet. As such, it uses the security it offered by your local installation of Java libraries.

    I found confirmation in this note of TAC: http://www.cisco.com/c/en/us/support/docs/security/adaptive-security-dev...

    I tried the instructions and (.. .wait for IT...) -It works!

    I went to the download page of Oracle for my Java version 8 here: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-21...

    I then these decompressed files and put them in the subdirectory appropriate according to the readme file. It was a little difficult to figure out exactly which of the several Java ASDM directories used - I have done this, right click on the process in the Task Manager, then go to the location of the file.

    (Note: when you upgrade the Oracle, so it can write a new directory - you will have to periodically repeat this step.)

    Given that, I put the two new files, changed my SSL encryption algorithm customized to exclude the AES-128 and then revived ASDM. I started Wireshark with a capture filter for my address ASA and watched the negotiating TLS 1.2 negotiate the AES-256 encryption.

    In the sense of "it didn't happen if there is no pictures", extra points for the screenshot of the real package decode (open in a new tab to zoom in):

  • 2821 software - AES 256

    Hello

    I'm trying to determine if this router is the AES 256 encryption.

    CISCO2821-HSEC/K9 2821 Bundle w/AIM-VPN/SSL-2, Adv. IP Serv, SSL 10 S28NAISK9 - 12409T Cisco 2800 ADVANCED IP SERVICES 1

    AIM-VPN/SSL-2 a / 3DES / AES / SSL VPN encryption/Compression 1

    Since the Locator functionality of software that I can't determine the level of AES only making AES, can anyone help.

    John,

    AES is part of the Ipsec standard, IOS Ipsec support K9 image should have AES that automatically supports encryption of bit 128,192,256 algorithm.

    To veryfy on router simply do:

    Router (config) #crypto isakmp policy 1

    Router (config-isakmp) #encryption aes?

    Here is a link, it is you want to play as a reference.

    http://www.Cisco.com/en/us/Partner/Tech/tk583/TK372/technologies_tech_note09186a0080094203.shtml#intro

    Rgds

    -Jorge

  • Encryption with dbms_crypto does not correspond to vectors of tests published for OFB mode

    Hello

    I use the dbms_crypto package in Oracle Express 11.2 I am trying to see that changes of encryption according to the "operating mode".  For reference, I used vectors of tests published on the web site: AES Test vectors I used these test vectors for a while with several languages such as Python PyCrypto and have generally found the information on this page to be reliable.

    When you try to use the BBA (output feedback mode) with AES256 encryption, I get a result that does not match the name on the web site of Test vectors.  Curiously, the result I get when using BBA mode matches the indicated result on the vector of Test for the ECB mode Web site, and in fact, if I use dbms_crypto ECB mode I get the same result. (If I try the CBC mode, I get the result the CBC matches appear on the web site of Test vectors).

    This suggests that when you specify the OFB mode in the call to dbms_crypto.encrypt, it's actually using ECB instead.

    I'm happy to share my code with someone who is interested.  I have not write it here now, though. It's pretty simple.  I use to set the mode,

    l_modNUMBER: = dbms_crypto. ENCRYPT_AES256
    + dbms_crypto. CHAIN_OFB
    + DBMS_CRYPTO. PAD_NONE;

    very similar to the Oracle documentation on this topic.

    Thanks for your interest,

    Norbert Kremer

    Hi Norbert,.

    Please report to us that I did a quick test on versions Enterprise Edition 11.2.0.3 and the 12.1.0.1.0, the 12 c seems to be OK, but 11.2.0.3 has a problem:

    Using the first vector to test for the OFB 256 - bit AES encryption mode

    Encryption key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4

    Initialization vector, ciphertext Test vector

    6bc1bee22e409f96e93d7e117393172a dc7e84bfda79164b7ecd8486985d3860 000102030405060708090A0B0C0D0E0F

    Result:

    Connected to:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    With the partitioning option

    SQL > @ofb

    Result: F3EED1BDB5D2A03C064B5A7E3DB181F8

    Expected: dc7e84bfda79164b7ecd8486985d3860

    PL/SQL procedure successfully completed.

    Connected to:

    Database Oracle 12 c Enterprise Edition Release 12.1.0.1.0 - 64 bit Production

    With the options of partitioning, OLAP, advanced analytics and Real Application Testing

    SQL > @ofb

    Result: DC7E84BFDA79164B7ECD8486985D3860

    Expected: dc7e84bfda79164b7ecd8486985d3860

    PL/SQL procedure successfully completed.

    I'll file a bug for this issue shortly and put you here,

    Greetings,

    Damage ten Monkshood

  • PDF encryption: the string is encrypted with 0x0D gives error in Acrobat.

    I'm generating enrypted PDF using password with CFM "AESV3" Standard Security Manager that is, 256-bit AES. The problem is that if a string encrypted in the PDF file contains bytes 0x0D i.e 'CR', Acrobat 9 / X does not include it. The part/object of the PDF which is associated with such string behaves by mistake.  If the chain does not bytes 0x0D inside, it works fine. According to the PDF 1.7 specification, string can have independent CR byte.

    Any help is appreciated.

    Thank you.

    Good generalist is to use hex to binary strings (in general) or use octal escapes for all non-printable characters. It is not good practice to pack binary data in channels not modified, even if it works.

    But who cares about good practices, let us look at the standard. You are right that CR is allowed in a string, but what is it? The current standard (ISO 32000 - 1) clearly indicates that a CR (0x0D) appear unescaped in the chain will be the representation of 0X0A.

  • Need help with a 32-bit Thinapp had app to interact with Outlook 2010 x 64.

    It is a specific example, but this isn't the only application that I have a problem with any ideas are welcome.

    Here's the current scenario that drives me bananas.

    The Thinapp - Visio 2010 (32-bit, of course), packed under XP SP3 with Office 2003 is installed locally.

    Target OS - Win 7 x 64 with Office 2010 x 64 installed locally.

    Visio 2010 is running, you can virtually all do it... except, save and send-> Send as an attachment (or take the steps to e-mail).

    Basically, I tried it is difficult to explain the specific error, because they vary from "There is no default mail client installed" as many variations of "Reinstall outlook" absolutely nothing happening.

    The common theme is that the windows installer starts a repair for msmapi32.dll.  Insulation on the folder that contains msmapi32.dll (C:\Program Files\Common Files\System\MSMAPI\1033) is set to writecopy.  I even tried including msmapi32.dll inside the thinapp Visio, but I don't seem to be getting anywhere.

    Send as attachments work fine on XP SP3/Office 2003.  So I was wondering if anyone had some advice to get 32-bit apps to play nicely with x 64 apps.

    I tried to turn on/off WOWon64 in package.ini, I've got the following in my buildoptions

    ChildProcessEnvironmentDefault = virtual

    ChildProcessEnvironmentExceptions = Outlook.exe

    and VirtualiseOutofProcessCOM = 0

    All tips/tricks beyond the ordinary, much appreciated. For now, it's time for me to go home and have a beer.

    Cannot conclude something concrete now.

    It may be a good idea to install 32-bit office natively, and to observe the behavior. This way atleast we can reduce. Take your old installation that has worked for you in the other OS. Deploy it on 64 bit OS and see if it works.

    If there is a communication problem with the 64-bit native applications. We need to varify if that actually works of native office visio and 64-bit native 32-bit.

  • Acrobat (Reader) 8 not able to open AES-256 protection PDF rights management?

    Is this really true?

    Have not found a sheet explaining the requirements of Client-side, when

    PDF documencs with LCRM AES-256 encryption.

    In my lab, apparently, as if Reader-9 may open the thin documents, while Reader-8 fails to decrypt.

    Dilettanto

    Acrobat/Reader 9 was the first version to incorporate AES-256 code, so if you want to stay compatible with Reader 7 or 8 you must continue to use AES - 128. I think that's documented in help for the section that describes how the publishing strategy works.

    Jonathan

  • Could not get palm pilot tx to work with vista 64-bit

    I bought a Dell Studio Hybrid under Vista 64 - bit OS with 4 GB of RAM. .  However, according to the website Compatinbility Web of Microsoft Vista, Vista 64-bit is not compatible with the Palm TX, just Vista running 3 GB of RAM or less.  Anyone can tell me how to get my Palm TX for work (sync) with the Vista 64-bit operating system?

    I uninstalled the Palm, Inc., CD-ROM software and reinstalled only to get the same results: the Vista 64-bit operating system is not compatible with my handheld Palm, Inc.  Please note that even the Palm TX is compatible with all other operating systems Vista except for the 4 GB of RAM, 64-bit Vista oS Microsoft Compatibility Web site said.  Help.  I'd like to be able to sync my pocket computer with the data that I have previously placed on Microsoft Office Access 2007.  Now, when I try to sync, my office simply there and made the ocassional beeps (I guess for signals may not make the Palm TX with Vista 64-bit as function implies the Microsoft Web site.)

Maybe you are looking for

  • HP mini 1000 PC

    I have a hp mini 1000, I have not used in a while so I forgot my password! It keeps saying & amp; amp; quot; fatal error... System stopped. CNU9075DKL

  • Reading worksheet file reads that a single column

    Hello I have attached a simple VI and as a csv file.  The spreadsheet file reading reads only the first column.  I checked the delimiters in the notebook and everything seems OK.  Any ideas?  Thank you.

  • cRio Steper Motor Control NI9512 step by step

    Hello I have a project at the University, and I have to design a LabView VI to control a steper motor. Apparently, everything is installed correctly: cRio-9074 and NI 9512. The engine must be running to start. Problem is, I'm just new to Labview and

  • LaserJet Pro M275 TopShot: Scanning question/icon

    I use Windows 8.1 (64-bit) and I have a printer HP LaserJet Pro M275 TopShot.  When I got my HP computer, I got a HP scanning icon which I could click and scan easily and also to scan multiple pages into a single document.  I recently had to get a ne

  • X 220 SDS upgrade options

    What you guys would recommend doing? I heard that you can buy SDD drives 2.5 "and remove the envelope and you always make them fit.