Part of any good developer's toolkit, is a set of tools to aid the creation of a 'staging' or 'test' site that mirrors the production environment as closely as possible.

Often, you will want to change some details, baseurls, use test payment or shipping account details.

Generally this is pretty easy to script up in bash, python or even plain php. However magento encrypts some of the data it stores in core_config_data.

The following is the approach I use to update data in core_config_data  in an encrypted format magento will accept:

<?php
require_once 'app/Mage.php';
umask(0);
$app = Mage::app('default');
$data = $_SERVER['argv'][1];
$obj = Mage::getModel('core/encryption');
$helper = Mage::helper('core');
$obj->setHelper($helper);
echo $obj->encrypt($data);