Extract crypto algorithm field and add utility functions

Password field of a user in /etc/shadow contains 3 parts:
[Crypt algorithm, Salt, encrypted password]

Example: A value of "1" in crypt algorithm maps to MD5

Need to use the same crypt algorithm that is already used
before when the new password is to be updated.

Change-Id: Ib7d8e0ad6f3bcce30f5c2be89b4e033230c07bf4
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/Makefile.am b/Makefile.am
index 472dd06..aebc8a2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,9 @@
                 mainapp.cpp
 
 phosphor_user_manager_LDFLAGS = $(SDBUSPLUS_LIBS) \
-                                $(PHOSPHOR_DBUS_INTERFACES_LIBS)
+                                $(PHOSPHOR_DBUS_INTERFACES_LIBS) \
+                                -lcrypt \
+                                -lstdc++fs
 
 phosphor_user_manager_CXXFLAGS = $(SYSTEMD_CFLAGS) \
                                  $(PHOSPHOR_DBUS_INTERFACES_CFLAGS)