With OS X , is there a way to create a 640 x 640 image out of a 500 x 640 image? Some website requires the user to "crop" the photo, but sometimes you'd like to keep it original.

Using OS X alone, can a a 500 x 640 photo be enlarged to 640 x 640 (with white or black bars at the left and right), without installing additional apps?  (this can be viewed as, creating a 640 x 640 black image, and the pasting the 500 x 640 photo onto it).
You can use the sips command to pad any JPEG or BMP image to a specified size, with a specified colour. In your case, the command would look something like:

sips photo-500x640.jpg --padToHeightWidth 640 640 --padColor 000000 --out photo-640x640.jpg


obviously with the input and output filenames of your choice. For white instead of black borders, change 000000 to FFFFFF.