A method of synthesizing polyethyleneimine with a substantially linear backbone is disclosed. The method comprises exposing ethylenediamine dissolved in a solution to electromagnetic radiation for a sufficient time to polymerize the ethylenediamine and thereby resulting in formation of polyethylenimine with a substantially linear backbone in the solution. A method of synthesizing a homopolymer with a substantially linear backbone is also disclosed. In addition, a composition comprising polyethylenimine synthesized from the aforementioned method is disclosed, in which the polyethylenimine comprises a backbone conformation that is substantially linear and has a distribution of molecular weights (MW) ranging from 1 kDa to 200 kDa and the polyethyleneimine has no cytotoxicity at a concentration of 12 μg/ml.