How will writing the transaction part in Java benefit the security of the application, when all other parts are being written in PHP?

A friend of mine while working on a PHP application asked me to write one part of the application in Java. The part that involved transactions. He said it will be better to write this portion in Java. He talked about how secure it will be!

Though I was too busy to help him then, I want to know the essence of this idea. Why he was trying to use Java when he wrote the most part in PHP? Will it really boost up the security? And writing transactions in Java is only concerned with security?

The thing seems very interesting but I really have no idea, what it is! Please provide some insight into the topic.

Note: When I say transaction, it involves everything. From accessing account to transferring money.

9

Correctly utilizing a Language’s strong type system goes a long way towards reducing certain types of bugs – variants of the “provided the wrong argument to that method” bugs.

For example, think of the following function:

transfer_money(from_account, to_account, amount)

In an weakly-/untyped language, it’s easy to confuse the from_account and to_account parameters; It’s also common to use wrong units in amount (Dollars vs Cents, for example).

These errors would require rigorous testing to be found, or very thorough manual code-reviewing.

OTOH, an (extreme) use of types will result in this kind of method:

transfer_money(SourceAccount from_account, 
               TargetAccount to_account,
               MoneyAmount   amount)

The same kind of errors here will produce a compilation error, which makes them a lot less likely to actually reach production.

Now, this isn’t to say that Java is inherently safer than PHP; Nor that a similar system cannot be easily implemented in PHP; Nor that it’s actually common to use types in this fashion in Java; But it does give Java a tiny edge over PHP for critical paths of code. From a Safety Engineering POV, it makes Java “safer”.

1

I don’t think there’s any truth behind that idea. Two main things that would be different by using Java are the JVM and the code itself.

  1. JVM. I’m not an expert in the details of jvm but there are PHP implementation for jvm (e.g. http://www.caucho.com/resin-3.1/doc/quercus.xtp). They promoted security as one of the feature but they only pointed out buggy php extensions, i.e. not flaw in PHP itself.

  2. The code. If your friend can code secure transaction in Java, you should be able to re-implement it in PHP and it will have the same level of security (good or bad). It’s pretty straight forward to check that the two implementations have same behavior, although proofing them to be secure is a whole different story.

Especially within the transaction code scope, I don’t think there is proof that Java is inherently more secure than PHP.

One area coding in Java can be considered more secure is in the region of file storage.

With Java, a byte-code file can be stored where the program will be run. If a compiled Java file is found, it can only be run with a Java virtual machine, and not read or easily reverse engineered.

In PHP, a script file filled with readable text is what is stored. So if somehow the file was found, then the program could be read with a simple text editor like Notepad or Emacs.

What this means for security is that the inner workings of the program would be hidden if written in Java. And only in the event that someone had access to the program file. Normally, with PHP the program exists on a web server and is executed without visibility in a Web Browser. Your friend, however, probably wants to be extra careful.

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật