Both of the above answers are right, just want to mention another method.
You can use the Polygon.createRegularPolygon() method as well when you know the Center of your square but don't know or don't want to calculate the square bounds. Meaning you're drawing a square around some center point.
Now for circle, you'd pass in like 30+ points, and it would look circle-like enough. But square needs 4. But then the side Length gets messed up (and perimeter and area). So note the math below to correct the error:
function makeSquare(center_lat, center_lon, p_radius, p_units)
{
var radiusMiles = ...my radius...; // however you get it
var arrConversion = [];
arrConversion['degrees'] = ( 1 / (60 * 1.1508) );
arrConversion['dd'] = arrConversion['degrees'];
arrConversion['m'] = ( 1609.344);
arrConversion['ft'] = ( 5280 );
arrConversion['km'] = ( 1.609344 );
arrConversion['mi'] = ( 1 );
arrConversion['inches'] = ( 63360 );
// need to multiply by sqrt(2)/2 or 1.41421356/2 because
// were passing in RADIUS and that's a diagonal when drawing the square. so we have to
// adjust by root 2 so we get the actual sides in length that we want
var r = radiusMiles
* arrConversion[ this.map.getProjectionObject().proj.units]
* 1.41421356 /2 ;
var c = new OpenLayers.Geometry.Point( center_lon, center_lat )
.transform( new OpenLayers.Projection("EPSG:4326"), this.map.getProjectionObject() );
var f = new OpenLayers.Feature.Vector();
f.geometry = OpenLayers.Geometry.Polygon.createRegularPolygon(
c
, r
, 4 // SQUARE
, 0 // no rotation
);
return f;
}