Magnetic nanowires by electrodeposition within templates